mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
markAliasReferenced should include ExportValue as well (#51219)
This commit is contained in:
@@ -26035,13 +26035,13 @@ namespace ts {
|
||||
function markAliasReferenced(symbol: Symbol, location: Node) {
|
||||
if (isNonLocalAlias(symbol, /*excludes*/ SymbolFlags.Value) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, SymbolFlags.Value)) {
|
||||
const target = resolveAlias(symbol);
|
||||
if (getAllSymbolFlags(target) & SymbolFlags.Value) {
|
||||
if (getAllSymbolFlags(target) & (SymbolFlags.Value | SymbolFlags.ExportValue)) {
|
||||
// An alias resolving to a const enum cannot be elided if (1) 'isolatedModules' is enabled
|
||||
// (because the const enum value will not be inlined), or if (2) the alias is an export
|
||||
// of a const enum declaration that will be preserved.
|
||||
if (compilerOptions.isolatedModules ||
|
||||
shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) ||
|
||||
!isConstEnumOrConstEnumOnlyModule(target)
|
||||
!isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))
|
||||
) {
|
||||
markAliasSymbolAsReferenced(symbol);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user