Title: Enum value `1 / 0` incorrectly transformed if there is `Infinity` declared in scope · Issue #55091 · microsoft/TypeScript · GitHub
Open Graph Title: Enum value `1 / 0` incorrectly transformed if there is `Infinity` declared in scope · Issue #55091 · microsoft/TypeScript
X Title: Enum value `1 / 0` incorrectly transformed if there is `Infinity` declared in scope · Issue #55091 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms infinity enum variable let shadow 🕗 Version & Regression Information Every version I tested ⏯ Playground Link Playground link with relevant code 💻 Code { let Infinity = 3; enum A { X = 1 / 0 } console.log(A.X) }...
Open Graph Description: Bug Report 🔎 Search Terms infinity enum variable let shadow 🕗 Version & Regression Information Every version I tested ⏯ Playground Link Playground link with relevant code 💻 Code { let Infinity = 3;...
X Description: Bug Report 🔎 Search Terms infinity enum variable let shadow 🕗 Version & Regression Information Every version I tested ⏯ Playground Link Playground link with relevant code 💻 Code { let Infinity ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/55091
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enum value `1 / 0` incorrectly transformed if there is `Infinity` declared in scope","articleBody":"# Bug Report\r\n\r\n### 🔎 Search Terms\r\n\r\ninfinity enum variable let shadow\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nEvery version I tested\r\n\r\n### ⏯ Playground Link\r\n\r\n\u003c!--\r\n A link to a TypeScript Playground \"Share\" link which shows this behavior.\r\n This should have the same code as the code snippet below, and use whichever settings are relevant to your report.\r\n\r\n As a last resort, you can link to a repo, but these will be slower for us to investigate.\r\n-->\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?#code/N4KABGA2CmAuYEkB2AzAlktsCeYC8YAzANwjhjRICuAtmAIJigQQAa+YAjGAPRgAM5AL5kIAYwD2SAM4SYAOkgSA5gAp681gEoQQoA)\r\n\r\n### 💻 Code\r\n\r\n\u003c!-- Please post the relevant code sample here as well. This code and the Playground code should be the same, do not use separate examples -->\r\n```ts\r\n{\r\n let Infinity = 3;\r\n\r\n enum A {\r\n X = 1 / 0\r\n }\r\n\r\n console.log(A.X)\r\n}\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\n```js\r\n{\r\n let Infinity = 3;\r\n let A;\r\n (function (A) {\r\n A[A[\"X\"] = Infinity] = \"X\";\r\n })(A || (A = {}));\r\n console.log(A.X);\r\n}\r\n```\r\n\r\nand logs `3`\r\n\r\n### 🙂 Expected behavior\r\n\r\nIt should log the result of `1 / 0`, which is `Infinity`.\r\n\r\nSomewhat related to https://github.com/microsoft/TypeScript/issues/54981.\r\n","author":{"url":"https://github.com/nicolo-ribaudo","@type":"Person","name":"nicolo-ribaudo"},"datePublished":"2023-07-20T11:48:11Z","url":"https://github.com/microsoft/TypeScript/issues/55091"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:9b4b2725-834f-bbf5-b3c9-6c5c5e71cdeb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DCF4:117C62:1B58DAB:246EFA7:6B0160A6 |
| html-safe-nonce | f99bb3d5e9b9a2c713f866749b813390ab4f395c825fb018424ded615522b2b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQ0Y0OjExN0M2MjoxQjU4REFCOjI0NkVGQTc6NkIwMTYwQTYiLCJ2aXNpdG9yX2lkIjoiODgzMzAwNjY3NDQ3OTUwNTU3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7530df702439b281162f33468e5190ef28be319b0d2ba9400adf0f2a868bb2bc |
| hovercard-subject-tag | issue:1813810847 |
| 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/55091/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7421b3c7ae29f5eb312bcc50609cdc5ea3fc9be5715f4876f03b17e1c4cdf262/microsoft/TypeScript/issues/55091 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7421b3c7ae29f5eb312bcc50609cdc5ea3fc9be5715f4876f03b17e1c4cdf262/microsoft/TypeScript/issues/55091 |
| og:image:alt | Bug Report 🔎 Search Terms infinity enum variable let shadow 🕗 Version & Regression Information Every version I tested ⏯ Playground Link Playground link with relevant code 💻 Code { let Infinity = 3;... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nicolo-ribaudo |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width