With #60052, we now emit qualified names rather than generate an index signature for computed names in classes; however, this now puts us in an awkward place where regardless of errors, declaration emit diverges on isolatedDeclarations.
Playground Links:
exportconstgreeting: unique symbol=Symbol();exportconstcount: unique symbol=Symbol();exportclassMyClass1{[greeting]: string="world";[count]: number=42;}exportenumPropertyNames{greeting="greeting",count="count",}exportclassMyClass2{[PropertyNames.greeting]: string="world";[PropertyNames.count]: number=42;}exportletprop!: string;exportclassMyClass3{[prop]: ()=>void=()=>{}}Compared to --isolatedDeclarations false The declaration emit lacks expected contents in MyClass1 and MyClass2:
export declare const greeting: unique symbol;
export declare const count: unique symbol;
export declare class MyClass1 {
- [greeting]: string;- [count]: number;
}
export declare enum PropertyNames {
greeting = "greeting",
count = "count"
}
export declare class MyClass2 {
- [PropertyNames.greeting]: string;- [PropertyNames.count]: number;
}
export declare let prop: string;
export declare class MyClass3 {
[prop]: () => void;
}It is surprising that prop is emitted regardless of --isolatedDeclarations, but not the other contents.
With #60052, we now emit qualified names rather than generate an index signature for computed names in classes; however, this now puts us in an awkward place where regardless of errors, declaration emit diverges on
isolatedDeclarations.Playground Links:
isolatedDeclarationsisolatedDeclarationsisolatedDeclarationsCompared to
--isolatedDeclarations falseThe declaration emit lacks expected contents inMyClass1andMyClass2:export declare const greeting: unique symbol; export declare const count: unique symbol; export declare class MyClass1 { - [greeting]: string;- [count]: number; } export declare enum PropertyNames { greeting = "greeting", count = "count" } export declare class MyClass2 { - [PropertyNames.greeting]: string;- [PropertyNames.count]: number; } export declare let prop: string; export declare class MyClass3 { [prop]: () => void; }It is surprising that
propis emitted regardless of--isolatedDeclarations, but not the other contents.