diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 53e9c438797..50a2e12bf74 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4291,15 +4291,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } - // Aliases that resolve to const enums are not marked as referenced because they are not emitted, - // but their usage in value positions must be tracked to determine if the import can be type-only. - function markConstEnumAliasAsReferenced(symbol: Symbol) { - const links = getSymbolLinks(symbol); - if (!links.constEnumReferenced) { - links.constEnumReferenced = true; - } - } - // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, dontResolveAlias?: boolean): Symbol | undefined { // There are three things we might try to look for. In the following examples, @@ -29202,9 +29193,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { ) { markAliasSymbolAsReferenced(symbol); } - else { - markConstEnumAliasAsReferenced(symbol); - } } } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f22978b4648..a02f8aa47ab 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5916,7 +5916,6 @@ export interface SymbolLinks { inferredClassSymbol?: Map; // Symbol of an inferred ES5 constructor function mapper?: TypeMapper; // Type mapper for instantiation alias referenced?: boolean; // True if alias symbol has been referenced as a value that can be emitted - constEnumReferenced?: boolean; // True if alias symbol resolves to a const enum and is referenced as a value ('referenced' will be false) containingType?: UnionOrIntersectionType; // Containing union or intersection type for synthetic property leftSpread?: Symbol; // Left source for synthetic spread property rightSpread?: Symbol; // Right source for synthetic spread property