Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computed property name is not escaped in declaration emit #60819

Open
dragomirtitian opened this issue Dec 19, 2024 · 0 comments
Open

Computed property name is not escaped in declaration emit #60819

dragomirtitian opened this issue Dec 19, 2024 · 0 comments

Comments

@dragomirtitian
Copy link
Contributor

πŸ”Ž 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant