Skip to content

Commit 1af576b

Browse files
committed
Fix microsoft#4808: Follow target symbols
1 parent ff8e337 commit 1af576b

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

src/compiler/checker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16795,7 +16795,11 @@ namespace ts {
1679516795
return symbols;
1679616796
}
1679716797
else if (symbol.flags & SymbolFlags.Transient) {
16798-
const target = getSymbolLinks(symbol).target;
16798+
let target: Symbol;
16799+
let next: Symbol = symbol;
16800+
while (next = getSymbolLinks(next).target) {
16801+
target = next;
16802+
}
1679916803
if (target) {
1680016804
return [target];
1680116805
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////var x = {
4+
//// [|property|]: {}
5+
////};
6+
////
7+
////x.[|property|];
8+
////
9+
////let {[|property|]: pVar} = x;
10+
11+
12+
let ranges = test.ranges();
13+
for (let range of ranges) {
14+
goTo.position(range.start);
15+
16+
verify.referencesCountIs(ranges.length);
17+
for (let expectedReference of ranges) {
18+
verify.referencesAtPositionContains(expectedReference);
19+
}
20+
}

0 commit comments

Comments
 (0)