@@ -138,7 +138,7 @@ func (c *OpContext) evaluate(v *Vertex, r Resolver, state vertexStatus) Value {
138
138
// relax this again once we have proper tests to prevent regressions of
139
139
// that issue.
140
140
if ! v .state .done () || v .state .errs != nil {
141
- v .state .addNotify (c .vertex )
141
+ v .state .addNotify (c .vertex , nil )
142
142
}
143
143
}
144
144
@@ -444,7 +444,8 @@ func (n *nodeContext) doNotify() {
444
444
if n .errs == nil || len (n .notify ) == 0 {
445
445
return
446
446
}
447
- for _ , v := range n .notify {
447
+ for _ , rec := range n .notify {
448
+ v := rec .v
448
449
if v .state == nil {
449
450
if b , ok := v .BaseValue .(* Bottom ); ok {
450
451
v .BaseValue = CombineErrors (nil , b , n .errs )
@@ -974,7 +975,7 @@ type nodeContext struct {
974
975
975
976
// notify is used to communicate errors in cyclic dependencies.
976
977
// TODO: also use this to communicate increasingly more concrete values.
977
- notify []* Vertex
978
+ notify []receiver
978
979
979
980
// Conjuncts holds a reference to the Vertex Arcs that still need
980
981
// processing. It does NOT need to be copied.
@@ -1062,6 +1063,12 @@ type nodeContextState struct {
1062
1063
conjunctsPartialPos int
1063
1064
}
1064
1065
1066
+ // A receiver receives notifications.
1067
+ type receiver struct {
1068
+ v * Vertex
1069
+ cc * closeContext
1070
+ }
1071
+
1065
1072
// Logf substitutes args in format. Arguments of type Feature, Value, and Expr
1066
1073
// are printed in human-friendly formats. The printed string is prefixed and
1067
1074
// indented with the path associated with the current nodeContext.
@@ -1080,9 +1087,9 @@ type defaultInfo struct {
1080
1087
origMode defaultMode
1081
1088
}
1082
1089
1083
- func (n * nodeContext ) addNotify (v * Vertex ) {
1090
+ func (n * nodeContext ) addNotify (v * Vertex , cc * closeContext ) {
1084
1091
if v != nil && ! n .node .hasAllConjuncts {
1085
- n .notify = append (n .notify , v )
1092
+ n .notify = append (n .notify , receiver { v , cc } )
1086
1093
}
1087
1094
}
1088
1095
@@ -1693,7 +1700,7 @@ func (n *nodeContext) addVertexConjuncts(c Conjunct, arc *Vertex, inline bool) {
1693
1700
}
1694
1701
1695
1702
if arc .state != nil {
1696
- arc .state .addNotify (n .node )
1703
+ arc .state .addNotify (n .node , nil )
1697
1704
}
1698
1705
1699
1706
for _ , c := range arc .Conjuncts {
0 commit comments