Skip to content

Computed property name is not escaped in declaration emitΒ #60819

@dragomirtitian

Description

@dragomirtitian

πŸ”Ž Search Terms

computed property symbol declaration emit

πŸ•— Version & Regression Information

  • This changed between versions 3.7 and 3.8

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=3.7.5#code/MYGwhgzhAEAq0G8BQ1XQgFzBglsaATgKZgAmA9gHYgCe0A2gEQA6GjAugFzQCulOARx5F0NALYAjciADcSAL5IQRDNAAe0ALyIUaerCasOXaAEYFMoA

πŸ’» Code

class T {
    static readonly ["\t"]: unique symbol;
}
let x = {
    [T["\t"]]: 1
};

πŸ™ Actual behavior

The type of x is emitted as { [T["\t"]]: number; } in declaration files, making the file invalid since the property does not exist on T

πŸ™‚ Expected behavior

The escape should be preserved in the property name.

Additional information about the issue

Was introduced by 8bb7230

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts files

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions