Skip to content

Commit 3d07795

Browse files
authored
Fixed type lookup on non-exported value symbol when it has an export symbol (#52140)
1 parent 42530c3 commit 3d07795

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27198,7 +27198,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2719827198
}
2719927199

2720027200
function getTypeOfSymbolAtLocation(symbol: Symbol, location: Node) {
27201-
symbol = symbol.exportSymbol || symbol;
27201+
symbol = getExportSymbolOfValueSymbolIfExported(symbol);
2720227202

2720327203
// If we have an identifier or a property access at the given location, if the location is
2720427204
// an dotted name expression, and if the location is not an assignment target, obtain the type
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// <reference path='fourslash.ts' />
2+
// @strict: true
3+
////
4+
//// declare function num(): number
5+
//// const /*1*/Unit = num()
6+
//// export type Unit = number
7+
//// const value = /*2*/Unit
8+
////
9+
//// function Fn() {}
10+
//// export type Fn = () => void
11+
//// /*3*/Fn()
12+
////
13+
//// // repro from #41897
14+
//// const /*4*/X = 1;
15+
//// export interface X {}
16+
17+
verify.quickInfoAt("1", "const Unit: number");
18+
verify.quickInfoAt("2", "const Unit: number");
19+
20+
verify.quickInfoAt("3", "function Fn(): void");
21+
22+
verify.quickInfoAt("4", "const X: 1");

0 commit comments

Comments
 (0)