Skip to content

Commit a26e60e

Browse files
committed
skip implements types with no symbols
1 parent 9f872c0 commit a26e60e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6380,15 +6380,15 @@ namespace ts {
63806380
const typeParamDecls = map(localParams, p => typeParameterToDeclaration(p, context));
63816381
const classType = getDeclaredTypeOfClassOrInterface(symbol);
63826382
const baseTypes = getBaseTypes(classType);
6383-
const implementsTypes = getImplementsTypes(classType);
6383+
const implementsExpressions = mapDefined(getImplementsTypes(classType), serializeImplementedType);
63846384
const staticType = getTypeOfSymbol(symbol);
63856385
const isClass = !!staticType.symbol?.valueDeclaration && isClassLike(staticType.symbol.valueDeclaration);
63866386
const staticBaseType = isClass
63876387
? getBaseConstructorTypeOfClass(staticType as InterfaceType)
63886388
: anyType;
63896389
const heritageClauses = [
63906390
...!length(baseTypes) ? [] : [createHeritageClause(SyntaxKind.ExtendsKeyword, map(baseTypes, b => serializeBaseType(b, staticBaseType, localName)))],
6391-
...!length(implementsTypes) ? [] : [createHeritageClause(SyntaxKind.ImplementsKeyword, map(implementsTypes, b => serializeImplementedType(b)))]
6391+
...!length(implementsExpressions) ? [] : [createHeritageClause(SyntaxKind.ImplementsKeyword, implementsExpressions)]
63926392
];
63936393
const symbolProps = getNonInterhitedProperties(classType, baseTypes, getPropertiesOfType(classType));
63946394
const publicSymbolProps = filter(symbolProps, s => {
@@ -6914,7 +6914,9 @@ namespace ts {
69146914
if (ref) {
69156915
return ref;
69166916
}
6917-
return createExpressionWithTypeArguments(/*typeArgs*/ undefined, symbolToExpression(t.symbol, context, SymbolFlags.Type));
6917+
if (t.symbol) {
6918+
return createExpressionWithTypeArguments(/*typeArgs*/ undefined, symbolToExpression(t.symbol, context, SymbolFlags.Type));
6919+
}
69186920
}
69196921

69206922
function getUnusedName(input: string, symbol?: Symbol): string {

0 commit comments

Comments
 (0)