mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-07 18:25:51 -05:00
Fixed type lookup on non-exported value symbol when it has an export symbol (#52140)
This commit is contained in:
committed by
GitHub
parent
42530c3c8d
commit
3d07795092
@@ -27198,7 +27198,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
|
||||
function getTypeOfSymbolAtLocation(symbol: Symbol, location: Node) {
|
||||
symbol = symbol.exportSymbol || symbol;
|
||||
symbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
||||
|
||||
// If we have an identifier or a property access at the given location, if the location is
|
||||
// an dotted name expression, and if the location is not an assignment target, obtain the type
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
// @strict: true
|
||||
////
|
||||
//// declare function num(): number
|
||||
//// const /*1*/Unit = num()
|
||||
//// export type Unit = number
|
||||
//// const value = /*2*/Unit
|
||||
////
|
||||
//// function Fn() {}
|
||||
//// export type Fn = () => void
|
||||
//// /*3*/Fn()
|
||||
////
|
||||
//// // repro from #41897
|
||||
//// const /*4*/X = 1;
|
||||
//// export interface X {}
|
||||
|
||||
verify.quickInfoAt("1", "const Unit: number");
|
||||
verify.quickInfoAt("2", "const Unit: number");
|
||||
|
||||
verify.quickInfoAt("3", "function Fn(): void");
|
||||
|
||||
verify.quickInfoAt("4", "const X: 1");
|
||||
Reference in New Issue
Block a user