Skip to content

Commit

Permalink
fix: improve extension inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
0x706b committed Mar 29, 2023
1 parent 9344b66 commit 42f3ad8
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/compiler/checker.ts
Expand Up @@ -50157,23 +50157,21 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
forEach(clause.types, (node) => {
if (isIdentifier(node.expression)) {
const nodeType = getTypeOfNode(node.expression);
const typeSymbol = nodeType.symbol;
const valueDeclaration = typeSymbol?.valueDeclaration;
if (valueDeclaration) {
const declarationType = getTypeOfNode(valueDeclaration);
if (declarationType.symbol) {
heritageExtensions.add(declarationType.symbol);
}
if (declarationType.flags & TypeFlags.Intersection) {
forEach((declarationType as IntersectionType).types, (type) => {
if (type.symbol) {
heritageExtensions.add(type.symbol);
}
if (type.aliasSymbol) {
heritageExtensions.add(type.aliasSymbol);
}
})
}
if (nodeType.flags & TypeFlags.Intersection) {
forEach((nodeType as IntersectionType).types, (type) => {
if (type.symbol) {
heritageExtensions.add(type.symbol);
}
if (type.aliasSymbol) {
heritageExtensions.add(type.aliasSymbol);
}
})
}
if (nodeType.symbol) {
heritageExtensions.add(nodeType.symbol);
}
if (nodeType.aliasSymbol) {
heritageExtensions.add(nodeType.aliasSymbol)
}
} else if (isCallExpression(node.expression)) {
const resolvedSignature = getResolvedSignature(node.expression);
Expand Down

0 comments on commit 42f3ad8

Please sign in to comment.