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

LiteralPropertyName should allow BigInt #35982

Closed
JLHwung opened this issue Jan 3, 2020 · 2 comments · Fixed by #58608
Closed

LiteralPropertyName should allow BigInt #35982

JLHwung opened this issue Jan 3, 2020 · 2 comments · Fixed by #58608
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@JLHwung
Copy link

JLHwung commented Jan 3, 2020

TypeScript Version: 3.8.0-dev.20200101

Search Terms: bigint, property name

Code

({1n: 123});

Expected behavior:
No error

Actual behavior:
Property Assignment Expected

Playground Link: https://www.typescriptlang.org/play/?ts=3.8.0-dev.20200101&ssl=1&ssc=1&pln=1&pc=15#code/BQbwBAjAdgXJBMBmMBfAlAbiA
Related Issues:

tc39/test262#2457
https://bugs.chromium.org/p/v8/issues/detail?id=10083

ecd1245 should be partially reverted.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jan 6, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jan 6, 2020
@calebsander
Copy link
Contributor

This was discussed quite a bit when support for bigint was added to TypeScript. We decided that there weren't many good use cases for bigint keys and it made more sense to require an explicit conversion to string instead. For example, see #15096 (comment).
Can you explain why you think this behavior should be changed?

@lucacasonato
Copy link

This currently forbids valid JS syntax in TS files (with a very confusing error message). https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBDAnmYcCCcC8cDeAoOQuARgDsAuOAMwEMAbAZ2DwF8BuIA - even if not allowed in the checker, it should at least be allowed in the parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
6 participants