@@ -266,7 +266,7 @@ func (n *nodeContext) addResolver(v *Vertex, id CloseInfo, forceIgnore bool) Clo
266
266
267
267
if isClosed {
268
268
for i , x := range n .reqDefIDs {
269
- if x .id == id .outerID && id .hasOuter {
269
+ if x .id == id .outerID && id .outerID != 0 {
270
270
n .reqDefIDs [i ].ignore = false
271
271
break
272
272
}
@@ -280,7 +280,7 @@ func (n *nodeContext) addResolver(v *Vertex, id CloseInfo, forceIgnore bool) Clo
280
280
// This is the case, for instance, if a resolver resolves to a
281
281
// non-definition.
282
282
ignore = true
283
- case id .enclosingEmbed != 0 || ! id .hasOuter :
283
+ case id .enclosingEmbed != 0 || id .outerID == 0 :
284
284
// We have a reference within an inner embedding group. If this is
285
285
// a definition, or otherwise typo checked struct, we need to track
286
286
// the embedding for mutual compatibility.
@@ -333,7 +333,6 @@ func (n *nodeContext) addResolver(v *Vertex, id CloseInfo, forceIgnore bool) Clo
333
333
// subField updates a CloseInfo for subfields of a struct.
334
334
func (c * OpContext ) subField (ci CloseInfo ) CloseInfo {
335
335
ci .outerID = 0
336
- ci .hasOuter = false
337
336
ci .enclosingEmbed = 0
338
337
return ci
339
338
}
@@ -428,14 +427,12 @@ func (n *nodeContext) splitDefID(s *StructLit, id CloseInfo) CloseInfo {
428
427
// TODO(evalv3): use a more principled detection mechanism.
429
428
// TODO: set this as a flag in StructLit so as to not have to
430
429
// do the somewhat dangerous cast here.
431
- // id.hasOuter = true
432
430
return id
433
431
}
434
432
435
433
id , dstID := n .newGroup (id )
436
434
437
- if ! id .hasOuter {
438
- id .hasOuter = true
435
+ if id .outerID == 0 {
439
436
id .outerID = dstID
440
437
}
441
438
0 commit comments