@@ -68,12 +68,18 @@ func walkDynamicObjectsInStack[Output any](
68
68
walk .AsyncTask (ctx , func (ctx context.Context ) {
69
69
insts , unknown := call .Instances (ctx , phase )
70
70
71
- // If unknown, then process the unknown instance and skip the rest.
72
71
if unknown {
72
+
73
+ // If unknown, then we should check for any stacks that exist
74
+ // in the state and "claim" them. Basically, this means this
75
+ // value was known and created some stack instances previously
76
+ // then became unknown in the current operation and we want to
77
+
73
78
knownInstances := stack .KnownEmbeddedStacks (call .addr .Item , phase )
74
79
if len (knownInstances ) == 0 {
75
80
// with no known instances, we'll just process the constant
76
- // unknown instance
81
+ // unknown instance. This represents the idea that stacks
82
+ // could be created once the value becomes unknown.
77
83
inst := call .UnknownInstance (ctx , phase )
78
84
visit (ctx , walk , inst )
79
85
@@ -82,8 +88,9 @@ func walkDynamicObjectsInStack[Output any](
82
88
return
83
89
}
84
90
85
- // otherwise we have instances, so we'll process those with
86
- // dedicated instances
91
+ // otherwise we have known instances in the state, so we'll
92
+ // create some dynamic instances for them so the user doesn't
93
+ // worry they have just disappeared.
87
94
88
95
for inst := range knownInstances {
89
96
if inst .Key == addrs .WildcardKey {
0 commit comments