@@ -392,12 +392,12 @@ func CtyToLua(arg cty.Value, l *lua.State) error {
392392
393393func LuaToCty (l * lua.State ) (cty.Value , error ) {
394394 if l .IsNone (- 1 ) {
395- return cty .NilVal , fmt .Errorf ("none value should not be returned" )
395+ return cty .NullVal ( cty . DynamicPseudoType ) , fmt .Errorf ("none value should not be returned" )
396396 }
397397
398398 switch t := l .TypeOf (- 1 ); t {
399399 case lua .TypeNil :
400- return cty .NilVal , nil
400+ return cty .NullVal ( cty . DynamicPseudoType ) , nil
401401 case lua .TypeBoolean :
402402 return cty .BoolVal (l .ToBoolean (- 1 )), nil
403403 case lua .TypeNumber :
@@ -421,7 +421,7 @@ func LuaToCty(l *lua.State) (cty.Value, error) {
421421 // Decode key (also modifies)
422422 key , ok := l .ToString (- 1 )
423423 if ! ok {
424- return cty .NilVal , fmt .Errorf ("bad table index" )
424+ return cty .NullVal ( cty . DynamicPseudoType ) , fmt .Errorf ("bad table index" )
425425 }
426426
427427 l .Pop (1 )
@@ -453,8 +453,8 @@ func LuaToCty(l *lua.State) (cty.Value, error) {
453453 return cty .ObjectVal (mv ), nil
454454 }
455455 }
456- return cty .ListVal (av ), nil
456+ return cty .TupleVal (av ), nil
457457 default :
458- return cty .NilVal , fmt .Errorf ("unhanded return type %s!" , t )
458+ return cty .NullVal ( cty . DynamicPseudoType ) , fmt .Errorf ("unhanded return type %s!" , t )
459459 }
460460}
0 commit comments