@@ -388,7 +388,7 @@ export class LuaTranspiler {
388388 const expression = this . transpileExpression ( node . expression ) ;
389389
390390 // Use ipairs for array types, pairs otherwise
391- const isArray = tsEx . isArrayType ( this . checker . getTypeAtLocation ( node . expression ) ) ;
391+ const isArray = tsEx . isArrayType ( this . checker . getTypeAtLocation ( node . expression ) , this . checker ) ;
392392 const pairs = isArray ? "ipairs" : "pairs" ;
393393
394394 // Make header
@@ -410,7 +410,7 @@ export class LuaTranspiler {
410410 // Transpile expression
411411 const expression = this . transpileExpression ( node . expression ) ;
412412
413- if ( tsEx . isArrayType ( this . checker . getTypeAtLocation ( node . expression ) ) ) {
413+ if ( tsEx . isArrayType ( this . checker . getTypeAtLocation ( node . expression ) , this . checker ) ) {
414414 throw new TranspileError ( "Iterating over arrays with 'for in' is not allowed." , node ) ;
415415 }
416416
@@ -861,7 +861,7 @@ export class LuaTranspiler {
861861 return this . transpileStringCallExpression ( node ) ;
862862
863863 }
864- if ( tsEx . isArrayType ( expType ) ) {
864+ if ( tsEx . isArrayType ( expType , this . checker ) ) {
865865 return this . transpileArrayCallExpression ( node ) ;
866866 }
867867
@@ -1007,7 +1007,7 @@ export class LuaTranspiler {
10071007 case ts . TypeFlags . StringLiteral :
10081008 return this . transpileStringProperty ( node ) ;
10091009 case ts . TypeFlags . Object :
1010- if ( tsEx . isArrayType ( type ) ) {
1010+ if ( tsEx . isArrayType ( type , this . checker ) ) {
10111011 return this . transpileArrayProperty ( node ) ;
10121012 }
10131013 }
@@ -1083,7 +1083,7 @@ export class LuaTranspiler {
10831083 const index = this . transpileExpression ( node . argumentExpression ) ;
10841084
10851085 const type = this . checker . getTypeAtLocation ( node . expression ) ;
1086- if ( tsEx . isArrayType ( type ) || tsEx . isTupleType ( type ) ) {
1086+ if ( tsEx . isArrayType ( type , this . checker ) || tsEx . isTupleType ( type , this . checker ) ) {
10871087 return `${ element } [${ index } +1]` ;
10881088 } else if ( tsEx . isStringType ( type ) ) {
10891089 return `string.sub(${ element } ,${ index } +1,${ index } +1)` ;
@@ -1130,9 +1130,9 @@ export class LuaTranspiler {
11301130 if ( ts . isCallExpression ( node . initializer )
11311131 && tsEx . isTupleReturnFunction ( this . checker . getTypeAtLocation ( node . initializer . expression ) , this . checker )
11321132 ) {
1133- return `local ${ vars } =${ value } ` ;
1133+ return `local ${ vars } =${ value } \n ` ;
11341134 } else {
1135- return `local ${ vars } =unpack(${ value } )` ;
1135+ return `local ${ vars } =unpack(${ value } )\n ` ;
11361136 }
11371137 } else {
11381138 throw new TranspileError (
0 commit comments