mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-06 14:23:20 -05:00
Deduplicate declarations in combined type/value symbols (#23593)
This commit is contained in:
@@ -1841,7 +1841,7 @@ namespace ts {
|
||||
return valueSymbol;
|
||||
}
|
||||
const result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName);
|
||||
result.declarations = concatenate(valueSymbol.declarations, typeSymbol.declarations);
|
||||
result.declarations = deduplicate(concatenate(valueSymbol.declarations, typeSymbol.declarations), equateValues);
|
||||
result.parent = valueSymbol.parent || typeSymbol.parent;
|
||||
if (valueSymbol.valueDeclaration) result.valueDeclaration = valueSymbol.valueDeclaration;
|
||||
if (typeSymbol.members) result.members = typeSymbol.members;
|
||||
@@ -1876,7 +1876,7 @@ namespace ts {
|
||||
|
||||
let symbolFromVariable: Symbol;
|
||||
// First check if module was specified with "export=". If so, get the member from the resolved type
|
||||
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=" as __String)) {
|
||||
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get(InternalSymbolName.ExportEquals)) {
|
||||
symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.escapedText);
|
||||
}
|
||||
else {
|
||||
@@ -1889,7 +1889,7 @@ namespace ts {
|
||||
if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === InternalSymbolName.Default) {
|
||||
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
||||
}
|
||||
const symbol = symbolFromModule && symbolFromVariable ?
|
||||
const symbol = symbolFromModule && symbolFromVariable && symbolFromModule !== symbolFromVariable ?
|
||||
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
|
||||
symbolFromModule || symbolFromVariable;
|
||||
if (!symbol) {
|
||||
|
||||
Reference in New Issue
Block a user