Skip to content

Commit

Permalink
feat: support class definition as per .d.ts; extending a const.
Browse files Browse the repository at this point in the history
  • Loading branch information
patroza committed Mar 5, 2023
1 parent e8c990f commit d8168f0
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/compiler/checker.ts
Expand Up @@ -49656,7 +49656,26 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
forEach(heritage, (clause) => {
forEach(clause.types, (node) => {
const type = getTypeOfNode(node);
if (isCallExpression(node.expression)) {
if (isIdentifier(node.expression)) {
const links = getNodeLinks(node.expression);
const declaration = links.resolvedSymbol?.valueDeclaration
const vType = declaration && checker.getTypeAtLocation(declaration)
if (vType) {
if (vType.symbol) {
heritageExtensions.add(vType.symbol);
}
if (vType.flags & TypeFlags.Intersection) {
forEach((vType as IntersectionType).types, (type2) => {
if (type2.symbol) {
heritageExtensions.add(type2.symbol);
}
if (type2.aliasSymbol) {
heritageExtensions.add(type2.aliasSymbol);
}
});
}
}
} else if (isCallExpression(node.expression)) {
const resolvedSignature = getResolvedSignature(node.expression);
const returnType = resolvedSignature.resolvedReturnType
if (returnType) {
Expand Down

0 comments on commit d8168f0

Please sign in to comment.