@@ -117,7 +117,7 @@ func morphListToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath)
117117 case t .Is (tftypes.List {}):
118118 var nlvals []tftypes.Value = make ([]tftypes.Value , len (lvals ))
119119 for i , v := range lvals {
120- elp := p .WithElementKeyInt (int64 ( i ) )
120+ elp := p .WithElementKeyInt (i )
121121 nv , err := ValueToType (v , t .(tftypes.List ).ElementType , elp )
122122 if err != nil {
123123 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph list element into list element: %v" , elp .String (), err )
@@ -131,7 +131,7 @@ func morphListToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath)
131131 }
132132 var tvals []tftypes.Value = make ([]tftypes.Value , len (lvals ))
133133 for i , v := range lvals {
134- elp := p .WithElementKeyInt (int64 ( i ) )
134+ elp := p .WithElementKeyInt (i )
135135 nv , err := ValueToType (v , t .(tftypes.Tuple ).ElementTypes [i ], elp )
136136 if err != nil {
137137 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph list element into tuple element: %v" , elp .String (), err )
@@ -142,7 +142,7 @@ func morphListToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath)
142142 case t .Is (tftypes.Set {}):
143143 var svals []tftypes.Value = make ([]tftypes.Value , len (lvals ))
144144 for i , v := range lvals {
145- elp := p .WithElementKeyInt (int64 ( i ) )
145+ elp := p .WithElementKeyInt (i )
146146 nv , err := ValueToType (v , t .(tftypes.Set ).ElementType , elp )
147147 if err != nil {
148148 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph list element into set element: %v" , elp .String (), err )
@@ -180,7 +180,7 @@ func morphTupleIntoType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePat
180180 }
181181 }
182182 for i , v := range tvals {
183- elp := p .WithElementKeyInt (int64 ( i ) )
183+ elp := p .WithElementKeyInt (i )
184184 nv , err := ValueToType (v , eltypes [i ], elp )
185185 if err != nil {
186186 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph tuple element into tuple element: %v" , elp .String (), err )
@@ -191,7 +191,7 @@ func morphTupleIntoType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePat
191191 case t .Is (tftypes.List {}):
192192 var lvals []tftypes.Value = make ([]tftypes.Value , len (tvals ))
193193 for i , v := range tvals {
194- elp := p .WithElementKeyInt (int64 ( i ) )
194+ elp := p .WithElementKeyInt (i )
195195 nv , err := ValueToType (v , t .(tftypes.List ).ElementType , elp )
196196 if err != nil {
197197 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph tuple element into list element: %v" , elp .String (), err )
@@ -202,7 +202,7 @@ func morphTupleIntoType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePat
202202 case t .Is (tftypes.Set {}):
203203 var svals []tftypes.Value = make ([]tftypes.Value , len (tvals ))
204204 for i , v := range tvals {
205- elp := p .WithElementKeyInt (int64 ( i ) )
205+ elp := p .WithElementKeyInt (i )
206206 nv , err := ValueToType (v , t .(tftypes.Set ).ElementType , elp )
207207 if err != nil {
208208 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph tuple element into set element: %v" , elp .String (), err )
@@ -226,7 +226,7 @@ func morphSetToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath) (
226226 case t .Is (tftypes.Set {}):
227227 var svals []tftypes.Value = make ([]tftypes.Value , len (svals ))
228228 for i , v := range svals {
229- elp := p .WithElementKeyInt (int64 ( i ) )
229+ elp := p .WithElementKeyInt (i )
230230 nv , err := ValueToType (v , t .(tftypes.Set ).ElementType , elp )
231231 if err != nil {
232232 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph set element into set element : %v" , elp .String (), err )
@@ -237,7 +237,7 @@ func morphSetToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath) (
237237 case t .Is (tftypes.List {}):
238238 var lvals []tftypes.Value = make ([]tftypes.Value , len (svals ))
239239 for i , v := range svals {
240- elp := p .WithElementKeyInt (int64 ( i ) )
240+ elp := p .WithElementKeyInt (i )
241241 nv , err := ValueToType (v , t .(tftypes.List ).ElementType , elp )
242242 if err != nil {
243243 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph set element into list element : %v" , elp .String (), err )
@@ -251,7 +251,7 @@ func morphSetToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath) (
251251 }
252252 var tvals []tftypes.Value = make ([]tftypes.Value , len (svals ))
253253 for i , v := range svals {
254- elp := p .WithElementKeyInt (int64 ( i ) )
254+ elp := p .WithElementKeyInt (i )
255255 nv , err := ValueToType (v , t .(tftypes.Tuple ).ElementTypes [i ], elp )
256256 if err != nil {
257257 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph list element into tuple element: %v" , elp .String (), err )
@@ -287,7 +287,7 @@ func morphMapToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath) (
287287 var nmvals map [string ]tftypes.Value = make (map [string ]tftypes.Value , len (mvals ))
288288 for k , v := range mvals {
289289 elp := p .WithElementKeyString (k )
290- nv , err := ValueToType (v , t .(tftypes.Map ).AttributeType , elp )
290+ nv , err := ValueToType (v , t .(tftypes.Map ).ElementType , 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 }
@@ -333,7 +333,7 @@ func morphObjectToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath
333333 var mvals map [string ]tftypes.Value = make (map [string ]tftypes.Value , len (vals ))
334334 for k , v := range vals {
335335 elp := p .WithElementKeyString (k )
336- nv , err := ValueToType (v , t .(tftypes.Map ).AttributeType , elp )
336+ nv , err := ValueToType (v , t .(tftypes.Map ).ElementType , elp )
337337 if err != nil {
338338 return tftypes.Value {}, elp .NewErrorf ("[%s] failed to morph object element into map element: %v" , elp .String (), err )
339339 }
0 commit comments