@@ -575,20 +575,30 @@ func getNonCyclicCount(c Conjunct) int {
575
575
}
576
576
}
577
577
578
+ // updateCyclicStatusV3 looks for proof of non-cyclic conjuncts to override
579
+ // a structural cycle.
580
+ func (n * nodeContext ) updateCyclicStatusV3 (c CloseInfo ) {
581
+ if ! c .IsCyclic {
582
+ n .hasNonCycle = true
583
+ for _ , c := range n .cyclicConjuncts {
584
+ ci := c .c .CloseInfo
585
+ ci .cc = n .node .rootCloseContext (n .ctx )
586
+ n .scheduleVertexConjuncts (c .c , c .arc , ci )
587
+ n .node .cc .decDependent (n .ctx , DEFER , nil )
588
+ }
589
+ n .cyclicConjuncts = n .cyclicConjuncts [:0 ]
590
+ }
591
+ }
592
+
578
593
// updateCyclicStatus looks for proof of non-cyclic conjuncts to override
579
594
// a structural cycle.
580
595
func (n * nodeContext ) updateCyclicStatus (c CloseInfo ) {
596
+ unreachableForDev (n .ctx )
597
+
581
598
if ! c .IsCyclic {
582
599
n .hasNonCycle = true
583
600
for _ , c := range n .cyclicConjuncts {
584
- if n .ctx .isDevVersion () {
585
- ci := c .c .CloseInfo
586
- ci .cc = n .node .rootCloseContext (n .ctx )
587
- n .scheduleVertexConjuncts (c .c , c .arc , ci )
588
- n .node .cc .decDependent (n .ctx , DEFER , nil )
589
- } else {
590
- n .addVertexConjuncts (c .c , c .arc , false )
591
- }
601
+ n .addVertexConjuncts (c .c , c .arc , false )
592
602
}
593
603
n .cyclicConjuncts = n .cyclicConjuncts [:0 ]
594
604
}
@@ -611,15 +621,14 @@ func assertStructuralCycle(n *nodeContext) bool {
611
621
}
612
622
613
623
func (n * nodeContext ) reportCycleError () {
614
- n .setBaseValue (CombineErrors (nil ,
615
- n .node .Value (),
616
- & Bottom {
617
- Code : StructuralCycleError ,
618
- Err : n .ctx .Newf ("structural cycle" ),
619
- Value : n .node .Value (),
620
- Node : n .node ,
621
- // TODO: probably, this should have the referenced arc.
622
- }))
624
+ b := & Bottom {
625
+ Code : StructuralCycleError ,
626
+ Err : n .ctx .Newf ("structural cycle" ),
627
+ Value : n .node .Value (),
628
+ Node : n .node ,
629
+ // TODO: probably, this should have the referenced arc.
630
+ }
631
+ n .setBaseValue (CombineErrors (nil , n .node .Value (), b ))
623
632
n .node .Arcs = nil
624
633
}
625
634
0 commit comments