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 {
533
533
let enclosingType = getEnclosingTypeOfThisType ( type ) ;
534
534
if ( enclosingType != null ) {
535
535
return "this;" + this . getId ( enclosingType , false ) ;
536
- } else if ( symbol . parent == null ) {
536
+ } else if ( symbol . parent == null || isFunctionTypeOrTypeAlias ( symbol . declarations ?. [ 0 ] ) ) {
537
537
// The type variable is bound on a call signature. Only extract it by name.
538
538
return "lextypevar;" + symbol . name ;
539
539
} else {
@@ -1328,3 +1328,8 @@ export class TypeTable {
1328
1328
}
1329
1329
}
1330
1330
}
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