Skip to content

Commit 7a1f34b

Browse files
committed
Fix type-morphing of Map into Map
1 parent 29ac242 commit 7a1f34b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

manifest/morph/morph.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,16 @@ func morphMapToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath) (
284284
}
285285
return tftypes.NewValue(t, ovals), nil
286286
case t.Is(tftypes.Map{}):
287-
var mvals map[string]tftypes.Value = make(map[string]tftypes.Value, len(mvals))
287+
var nmvals map[string]tftypes.Value = make(map[string]tftypes.Value, len(mvals))
288288
for k, v := range mvals {
289289
elp := p.WithElementKeyString(k)
290290
nv, err := ValueToType(v, t.(tftypes.Map).AttributeType, elp)
291291
if err != nil {
292292
return tftypes.Value{}, elp.NewErrorf("[%s] failed to morph object element into map element: %v", elp.String(), err)
293293
}
294-
mvals[k] = nv
294+
nmvals[k] = nv
295295
}
296-
return tftypes.NewValue(t, mvals), nil
296+
return tftypes.NewValue(t, nmvals), nil
297297
case t.Is(tftypes.DynamicPseudoType):
298298
return v, nil
299299
}

0 commit comments

Comments
 (0)