Use same condition in isReferencedAliasDeclaration as isAliasResolvedToValue (#28171) (#28219)

This commit is contained in:
Wesley Wigham
2018-10-30 11:19:05 -07:00
committed by GitHub
parent 9733858944
commit 7b5975382f
5 changed files with 449 additions and 1 deletions

View File

@@ -28274,7 +28274,8 @@ namespace ts {
return true;
}
const target = getSymbolLinks(symbol!).target; // TODO: GH#18217
if (target && getModifierFlags(node) & ModifierFlags.Export && target.flags & SymbolFlags.Value) {
if (target && getModifierFlags(node) & ModifierFlags.Export &&
target.flags & SymbolFlags.Value && (compilerOptions.preserveConstEnums || !isConstEnumOrConstEnumOnlyModule(target))) {
// An `export import ... =` of a value symbol is always considered referenced
return true;
}