mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Resolve aliases before using getTypereferenceType (#24594)
This commit is contained in:
@@ -9204,12 +9204,13 @@ namespace ts {
|
||||
}
|
||||
|
||||
function resolveImportSymbolType(node: ImportTypeNode, links: NodeLinks, symbol: Symbol, meaning: SymbolFlags) {
|
||||
links.resolvedSymbol = symbol;
|
||||
const resolvedSymbol = resolveSymbol(symbol);
|
||||
links.resolvedSymbol = resolvedSymbol;
|
||||
if (meaning === SymbolFlags.Value) {
|
||||
return links.resolvedType = getTypeOfSymbol(symbol);
|
||||
return links.resolvedType = getTypeOfSymbol(symbol); // intentionally doesn't use resolved symbol so type is cached as expected on the alias
|
||||
}
|
||||
else {
|
||||
return links.resolvedType = getTypeReferenceType(node, symbol);
|
||||
return links.resolvedType = getTypeReferenceType(node, resolvedSymbol); // getTypeReferenceType doesn't handle aliases - it must get the resolved symbol
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user