@@ -1393,7 +1393,7 @@ export class LuaTransformer {
13931393
13941394 const type = this . checker . getTypeAtLocation ( node ) ;
13951395 const context =
1396- tsHelper . getFunctionContextType ( type , this . checker ) !== tsHelper . ContextType . Void
1396+ tsHelper . getFunctionContextType ( type , this . program ) !== tsHelper . ContextType . Void
13971397 ? this . createSelfIdentifier ( )
13981398 : undefined ;
13991399 const [ paramNames , dots , restParamName ] = this . transformParameters ( node . parameters , context ) ;
@@ -1942,7 +1942,7 @@ export class LuaTransformer {
19421942
19431943 const type = this . checker . getTypeAtLocation ( functionDeclaration ) ;
19441944 const context =
1945- tsHelper . getFunctionContextType ( type , this . checker ) !== tsHelper . ContextType . Void
1945+ tsHelper . getFunctionContextType ( type , this . program ) !== tsHelper . ContextType . Void
19461946 ? this . createSelfIdentifier ( )
19471947 : undefined ;
19481948 const [ params , dotsLiteral , restParamName ] = this . transformParameters ( functionDeclaration . parameters , context ) ;
@@ -4017,7 +4017,7 @@ export class LuaTransformer {
40174017 const type = this . checker . getTypeAtLocation ( node ) ;
40184018
40194019 let context : tstl . Identifier | undefined ;
4020- if ( tsHelper . getFunctionContextType ( type , this . checker ) !== tsHelper . ContextType . Void ) {
4020+ if ( tsHelper . getFunctionContextType ( type , this . program ) !== tsHelper . ContextType . Void ) {
40214021 if ( ts . isArrowFunction ( node ) ) {
40224022 // dummy context for arrow functions with parameters
40234023 if ( node . parameters . length > 0 ) {
@@ -4215,7 +4215,7 @@ export class LuaTransformer {
42154215 const signatureDeclaration = signature && signature . getDeclaration ( ) ;
42164216 if (
42174217 signatureDeclaration &&
4218- tsHelper . getDeclarationContextType ( signatureDeclaration , this . checker ) === tsHelper . ContextType . Void
4218+ tsHelper . getDeclarationContextType ( signatureDeclaration , this . program ) === tsHelper . ContextType . Void
42194219 ) {
42204220 parameters = this . transformArguments ( expression . arguments , signature ) ;
42214221 } else {
@@ -4353,7 +4353,7 @@ export class LuaTransformer {
43534353 const signatureDeclaration = signature && signature . getDeclaration ( ) ;
43544354 if (
43554355 ! signatureDeclaration ||
4356- tsHelper . getDeclarationContextType ( signatureDeclaration , this . checker ) !== tsHelper . ContextType . Void
4356+ tsHelper . getDeclarationContextType ( signatureDeclaration , this . program ) !== tsHelper . ContextType . Void
43574357 ) {
43584358 // table:name()
43594359 return this . transformContextualCallExpression ( node , parameters ) ;
@@ -4392,7 +4392,7 @@ export class LuaTransformer {
43924392 const parameters = this . transformArguments ( node . arguments , signature ) ;
43934393 if (
43944394 ! signatureDeclaration ||
4395- tsHelper . getDeclarationContextType ( signatureDeclaration , this . checker ) !== tsHelper . ContextType . Void
4395+ tsHelper . getDeclarationContextType ( signatureDeclaration , this . program ) !== tsHelper . ContextType . Void
43964396 ) {
43974397 // A contextual parameter must be given to this call expression
43984398 return this . transformContextualCallExpression ( node , parameters ) ;
@@ -5152,7 +5152,7 @@ export class LuaTransformer {
51525152 protected transformFunctionCallExpression ( node : ts . CallExpression ) : tstl . CallExpression {
51535153 const expression = node . expression as ts . PropertyAccessExpression ;
51545154 const callerType = this . checker . getTypeAtLocation ( expression . expression ) ;
5155- if ( tsHelper . getFunctionContextType ( callerType , this . checker ) === tsHelper . ContextType . Void ) {
5155+ if ( tsHelper . getFunctionContextType ( callerType , this . program ) === tsHelper . ContextType . Void ) {
51565156 throw TSTLErrors . UnsupportedSelfFunctionConversion ( node ) ;
51575157 }
51585158 const signature = this . checker . getResolvedSignature ( node ) ;
@@ -5278,7 +5278,7 @@ export class LuaTransformer {
52785278 const signatureDeclaration = signature && signature . getDeclaration ( ) ;
52795279 const useSelfParameter =
52805280 signatureDeclaration &&
5281- tsHelper . getDeclarationContextType ( signatureDeclaration , this . checker ) !== tsHelper . ContextType . Void ;
5281+ tsHelper . getDeclarationContextType ( signatureDeclaration , this . program ) !== tsHelper . ContextType . Void ;
52825282
52835283 // Argument evaluation.
52845284 const callArguments = this . transformArguments ( expressions , signature ) ;
@@ -5690,8 +5690,8 @@ export class LuaTransformer {
56905690 fromTypeCache . add ( toType ) ;
56915691
56925692 // Check function assignments
5693- const fromContext = tsHelper . getFunctionContextType ( fromType , this . checker ) ;
5694- const toContext = tsHelper . getFunctionContextType ( toType , this . checker ) ;
5693+ const fromContext = tsHelper . getFunctionContextType ( fromType , this . program ) ;
5694+ const toContext = tsHelper . getFunctionContextType ( toType , this . program ) ;
56955695
56965696 if ( fromContext === tsHelper . ContextType . Mixed || toContext === tsHelper . ContextType . Mixed ) {
56975697 throw TSTLErrors . UnsupportedOverloadAssignment ( node , toName ) ;
@@ -6172,7 +6172,7 @@ export class LuaTransformer {
61726172 const decoratorExpressions = decorators . map ( decorator => {
61736173 const expression = decorator . expression ;
61746174 const type = this . checker . getTypeAtLocation ( expression ) ;
6175- const context = tsHelper . getFunctionContextType ( type , this . checker ) ;
6175+ const context = tsHelper . getFunctionContextType ( type , this . program ) ;
61766176 if ( context === tsHelper . ContextType . Void ) {
61776177 throw TSTLErrors . InvalidDecoratorContext ( decorator ) ;
61786178 }
0 commit comments