Allow late bound symbols in augmentations to merge into late bound symbol tables#29015
Allow late bound symbols in augmentations to merge into late bound symbol tables#29015weswigham wants to merge 3 commits into
Conversation
|
ping @rbuckton for a review~ |
| return links.resolvedSymbol = lateSymbol; | ||
| } | ||
| } | ||
| else { |
There was a problem hiding this comment.
Part of the reason to have a resolvedSymbol in the first place is to avoid doing the same work over and over again. I'm concerned that this code path would have a performance impact.
There was a problem hiding this comment.
This is within lateBindMember - we're just saying that if we attempt to late bind a symbol and the symbol is already resolved, but for some reason not in the late bound symbol table (eg, because it came from a global augmentation), that we add it to the late bound symbol table to it can actually be looked up by name later.
There was a problem hiding this comment.
You should check that resolvedSymbol is CheckFlags.Late, since we first assign it to decl.symbol to avoid recursion: https://github.com/Microsoft/TypeScript/pull/29015/files#diff-c3ed224e4daa84352f7f1abcd23e8ccaR6577. Otherwise, you might accidentally assign the wrong symbol in the lateSymbols table.
|
Your build is failing, can you take a look. |
|
Yeah, looks like one of the newer baselines I've added is affected by this; I'll have to go gin up the diff and add it. |
| return links.resolvedSymbol = lateSymbol; | ||
| } | ||
| } | ||
| else { |
There was a problem hiding this comment.
You should check that resolvedSymbol is CheckFlags.Late, since we first assign it to decl.symbol to avoid recursion: https://github.com/Microsoft/TypeScript/pull/29015/files#diff-c3ed224e4daa84352f7f1abcd23e8ccaR6577. Otherwise, you might accidentally assign the wrong symbol in the lateSymbols table.
|
Handled by #30970 |
Fixes #28334