Skip to content

Commit 42f3ad8

Browse files
committed
fix: improve extension inheritance
1 parent 9344b66 commit 42f3ad8

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/compiler/checker.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50157,23 +50157,21 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
5015750157
forEach(clause.types, (node) => {
5015850158
if (isIdentifier(node.expression)) {
5015950159
const nodeType = getTypeOfNode(node.expression);
50160-
const typeSymbol = nodeType.symbol;
50161-
const valueDeclaration = typeSymbol?.valueDeclaration;
50162-
if (valueDeclaration) {
50163-
const declarationType = getTypeOfNode(valueDeclaration);
50164-
if (declarationType.symbol) {
50165-
heritageExtensions.add(declarationType.symbol);
50166-
}
50167-
if (declarationType.flags & TypeFlags.Intersection) {
50168-
forEach((declarationType as IntersectionType).types, (type) => {
50169-
if (type.symbol) {
50170-
heritageExtensions.add(type.symbol);
50171-
}
50172-
if (type.aliasSymbol) {
50173-
heritageExtensions.add(type.aliasSymbol);
50174-
}
50175-
})
50176-
}
50160+
if (nodeType.flags & TypeFlags.Intersection) {
50161+
forEach((nodeType as IntersectionType).types, (type) => {
50162+
if (type.symbol) {
50163+
heritageExtensions.add(type.symbol);
50164+
}
50165+
if (type.aliasSymbol) {
50166+
heritageExtensions.add(type.aliasSymbol);
50167+
}
50168+
})
50169+
}
50170+
if (nodeType.symbol) {
50171+
heritageExtensions.add(nodeType.symbol);
50172+
}
50173+
if (nodeType.aliasSymbol) {
50174+
heritageExtensions.add(nodeType.aliasSymbol)
5017750175
}
5017850176
} else if (isCallExpression(node.expression)) {
5017950177
const resolvedSignature = getResolvedSignature(node.expression);

0 commit comments

Comments
 (0)