mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Merge multiple symbols even when re-exported (#49987)
* Merge multiple symbols even when re-exported As far as I remember, the target of `mergeSymbol` needs to be a merged symbol, not a symbol with a mergeId that points to mergedSymbol. However, mergeSymbolTable didn't check for this. I can't remember if symbol tables may contain symbols-with-mergeId. If they can, then mergeSymbolTable needs to call getMergedSymbol on the individual targets of the merge. That's what I did in this PR. * Call getMergeSymbol eagerly On the source, not target, of mergeSymbolTable's contents
This commit is contained in:
committed by
GitHub
parent
abc2a350e6
commit
dd98c17b10
@@ -1426,7 +1426,7 @@ namespace ts {
|
||||
function mergeSymbolTable(target: SymbolTable, source: SymbolTable, unidirectional = false) {
|
||||
source.forEach((sourceSymbol, id) => {
|
||||
const targetSymbol = target.get(id);
|
||||
target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : sourceSymbol);
|
||||
target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : getMergedSymbol(sourceSymbol));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user