8000 Simplify check for constructors · imskojs/TypeScript@b8af524 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit b8af524

Browse files
committed
Simplify check for constructors
1 parent ae559a7 commit b8af524

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,10 +2938,6 @@ namespace ts {
29382938
return type.resolvedBaseConstructorType;
29392939
}
29402940

2941-
function hasClassOrInterfaceBaseType(type: InterfaceType): boolean {
2942-
return !!forEach(getBaseTypes(type), t => !!(t.symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)));
2943-
}
2944-
29452941
function getBaseTypes(type: InterfaceType): ObjectType[] {
29462942
const isClass = type.symbol.flags & SymbolFlags.Class;
29472943
const isInterface = type.symbol.flags & SymbolFlags.Interface;
@@ -3375,9 +3371,6 @@ namespace ts {
33753371
}
33763372

33773373
function getDefaultConstructSignatures(classType: InterfaceType): Signature[] {
3378-
if (!hasClassOrInterfaceBaseType(classType)) {
3379-
return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false)];
3380-
}
33813374
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
33823375
const baseSignatures = getSignaturesOfType(baseConstructorType, SignatureKind.Construct);
33833376
if(baseSignatures.length === 0) {

0 commit comments

Comments
 (0)
0