File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -533,7 +533,7 @@ export class TypeTable {
533533 let enclosingType = getEnclosingTypeOfThisType ( type ) ;
534534 if ( enclosingType != null ) {
535535 return "this;" + this . getId ( enclosingType , false ) ;
536- } else if ( symbol . parent == null ) {
536+ } else if ( symbol . parent == null || isFunctionTypeOrTypeAlias ( symbol . declarations ?. [ 0 ] ) ) {
537537 // The type variable is bound on a call signature. Only extract it by name.
538538 return "lextypevar;" + symbol . name ;
539539 } else {
@@ -1328,3 +1328,8 @@ export class TypeTable {
13281328 }
13291329 }
13301330}
1331+
1332+ function isFunctionTypeOrTypeAlias ( declaration : ts . Declaration | undefined ) {
1333+ if ( declaration == null ) return false ;
1334+ return declaration . kind === ts . SyntaxKind . FunctionType || declaration . kind === ts . SyntaxKind . TypeAliasDeclaration ;
1335+ }
You can’t perform that action at this time.
0 commit comments