Fix assertion functions accessed via wildcard imports (#51324)

* Add test

* Resolve alias of property in getTypeOfDottedName

* Always resolve

* Update tests
This commit is contained in:
Jake Bailey
2022-10-27 20:27:53 -07:00
committed by GitHub
parent 64d0d5ae14
commit 3d2b4017eb
9 changed files with 380 additions and 1 deletions

View File

@@ -24490,6 +24490,7 @@ namespace ts {
}
function getExplicitTypeOfSymbol(symbol: Symbol, diagnostic?: Diagnostic) {
symbol = resolveSymbol(symbol);
if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.ValueModule)) {
return getTypeOfSymbol(symbol);
}
@@ -24529,7 +24530,7 @@ namespace ts {
switch (node.kind) {
case SyntaxKind.Identifier:
const symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node as Identifier));
return getExplicitTypeOfSymbol(symbol.flags & SymbolFlags.Alias ? resolveAlias(symbol) : symbol, diagnostic);
return getExplicitTypeOfSymbol(symbol, diagnostic);
case SyntaxKind.ThisKeyword:
return getExplicitThisType(node);
case SyntaxKind.SuperKeyword: