Title: enum member key should reject bigint · Issue #61772 · microsoft/TypeScript · GitHub
Open Graph Title: enum member key should reject bigint · Issue #61772 · microsoft/TypeScript
X Title: enum member key should reject bigint · Issue #61772 · microsoft/TypeScript
Description: 🔎 Search Terms enum, bigint, member key 🕗 Version & Regression Information This is the behavior in every version I tried. ⏯ Playground Link https://www.typescriptlang.org/play/?#code/KYOwrgtgBAolDeAoKKoAYRQLzsQXyA 💻 Code enum E { 0n = 0 ...
Open Graph Description: 🔎 Search Terms enum, bigint, member key 🕗 Version & Regression Information This is the behavior in every version I tried. ⏯ Playground Link https://www.typescriptlang.org/play/?#code/KYOwrgtgBAolDe...
X Description: 🔎 Search Terms enum, bigint, member key 🕗 Version & Regression Information This is the behavior in every version I tried. ⏯ Playground Link https://www.typescriptlang.org/play/?#code/KYOwrgtgBA...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/61772
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"enum member key should reject bigint","articleBody":"### 🔎 Search Terms\n\nenum, bigint, member key\n\n### 🕗 Version \u0026 Regression Information\n\nThis is the behavior in every version I tried.\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?#code/KYOwrgtgBAolDeAoKKoAYRQLzsQXyA\n\n### 💻 Code\n\n```ts\nenum E {\n 0n = 0\n}\n```\n\n\n### 🙁 Actual behavior\n\nTransformed to\n```js\n\"use strict\";\nvar E;\n(function (E) {\n E[E[0n] = 0] = 0n;\n})(E || (E = {}));\n\n```\nwithout error\n\n### 🙂 Expected behavior\n\nIt should throw an error \"An enum member cannot have a numeric name.\", similar to how we handle `enum E { 0 = 0 }`. Disallowing numeric value `0` but allowing bigInt value `0n` as enum member key seems inconsistent.\n\n### Additional information about the issue\n\nFirst reported in https://github.com/babel/babel/issues/17331.","author":{"url":"https://github.com/JLHwung","@type":"Person","name":"JLHwung"},"datePublished":"2025-05-27T20:19:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/61772/TypeScript/issues/61772"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1c001899-20f8-aa19-7fe7-57bdb2f6775e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A550:1F08:8C9336:C1B2F7:6A4D74B8 |
| html-safe-nonce | c5fd1857e22e4f680dc9eedd0d83105c050a829ccfa69e88bbe5635e878ab987 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTUwOjFGMDg6OEM5MzM2OkMxQjJGNzo2QTRENzRCOCIsInZpc2l0b3JfaWQiOiI0NDAyNDM3NzE3NTE1NjYyNTIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ed89f6401502e460da4647e8666943a6f642bff2896a7e0201acdeffb4187455 |
| hovercard-subject-tag | issue:3095097496 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/61772/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5b93291e5dcd91c582a44d99d609f260c7873d59d5864b34912c222e13831c38/microsoft/TypeScript/issues/61772 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5b93291e5dcd91c582a44d99d609f260c7873d59d5864b34912c222e13831c38/microsoft/TypeScript/issues/61772 |
| og:image:alt | 🔎 Search Terms enum, bigint, member key 🕗 Version & Regression Information This is the behavior in every version I tried. ⏯ Playground Link https://www.typescriptlang.org/play/?#code/KYOwrgtgBAolDe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JLHwung |
| hostname | github.com |
| expected-hostname | github.com |
| None | c78260c7b3f4ac4b0356c8208537f05406a3a2d46a9ec3f735b372dcc519c39e |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 399fff412f48461d435721c009efc17ea44be72f |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width