René's URL Explorer Experiment


Title: ES2022 Class Decorators not working when Class has self-static member · Issue #52004 · microsoft/TypeScript · GitHub

Open Graph Title: ES2022 Class Decorators not working when Class has self-static member · Issue #52004 · microsoft/TypeScript

X Title: ES2022 Class Decorators not working when Class has self-static member · Issue #52004 · microsoft/TypeScript

Description: Bug Report Class decorators are not working properly when the class has a static field of the same type and is instantiating it statically. Seems like this only happens when targeting ES2022. 🔎 Search Terms Various combinations of the be...

Open Graph Description: Bug Report Class decorators are not working properly when the class has a static field of the same type and is instantiating it statically. Seems like this only happens when targeting ES2022. 🔎 Sea...

X Description: Bug Report Class decorators are not working properly when the class has a static field of the same type and is instantiating it statically. Seems like this only happens when targeting ES2022. 🔎 Sea...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/52004

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ES2022 Class Decorators not working when Class has self-static member","articleBody":"# Bug Report\r\n\r\nClass decorators are not working properly when the class has a static field of the same type and is instantiating it statically. Seems like this only happens when targeting ES2022.\r\n\r\n### 🔎 Search Terms\r\n\r\nVarious combinations of the below search strings. Haven't been able to find anything useful.\r\nBeen searching for several days now, these are just the most recent ones I could remember:\r\n\r\n- Typescript class decorator with static property not working\r\n- Typescript decorators: TypeError: undefined is not a constructor\r\n- Typescript decorators not working (with es2022)\r\n- Typescript decorator es2022\r\n- Angular custom decorators not working\r\n- Angular custom decorators with aot\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nRegressed when `tsconfig.compilerOptions.target` is ES2022. Other ES versions that I tried seem to be working as expected.\r\nTried Nightly version in the playground, could still repro it (after I changed target to ES2022 in TSConfig).\r\n\r\n### ⏯ Playground Link\r\n\r\n[Bug repro in Playground](https://www.typescriptlang.org/play?target=9&jsx=0&module=7&ts=5.0.0-dev.20221223#code/GYVwdgxgLglg9mABAWQKYGd0EMDmqAU0cATgFyIBi408YAlAFADeDAkBAunADaoB03ODnwADAEqocMdFGIwwOcgCIAJEyLE+YLAFtUAXyUi6Abgb6GDAAJpMuVAwjcsmRAAV5OW9jzM2ABxAAI24YCEQZLFhwgBFUYCwQbihyDwVve0QAXkQwVAB3d08MvHxTRAB6CsQAbQBBAF0A4NDwjjAZYhANfECQsMRiVCwAEwRuAE9EADUsbhBUck7PbMQlNJwlOkQmRAsLBiqi9IwffjiEpKhVvMKNkoJyo5qAISb2rl4BIXx70-s+BdEsk+LN5qhTJYjgBlfJYfz+FbySJgWBRWiIYDEOA6WqNRBQOC1N6DVBgEaoYjoAkAC2kiA4FMQ+RIAGtPHxDtVoahUDpqaFWagGZxZN1CcREPSwHBrhTgPJUCNmahuNxmXTeFKOlAsKiYOiFIgsBFddFEHodEFKcyYFA6Ug7dS4PkkE4XOhOUA)\r\nYou can try setting e.g. ES2021, and the code works, but not on ES2022.\r\n\r\n### 💻 Code\r\n\r\n`src\\index.ts`:\r\n```ts\r\nfunction Message(ctor: Function)\r\n{\r\n    console.log(`Registring: \"${ctor.name}\"`);\r\n}\r\n\r\n@Message\r\nclass PingMessage\r\n{\r\n    public static Default: PingMessage = new PingMessage(); // [A]\r\n    public constructor(public readonly Value: string = \"Ping\") { }\r\n}\r\n\r\n// PingMessage.Default = new PingMessage(); // [B]\r\nconsole.log(PingMessage.Default.Value);\r\n\r\n// Swapping instantiation from [A] to [B] renders this code working.\r\n// Seems like constructor is not defined well while instantiating a static member within its own class.\r\n```\r\n\r\n`package.json`:\r\n```json\r\n{\r\n  \"name\": \"decorator-test\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"Test App\",\r\n  \"scripts\": {\r\n    \"start\": \"(if exist dist rd /S /Q dist) >nul 2>nul && tsc && node ./dist/index.js\"\r\n  },\r\n  \"dependencies\": {\r\n    \"tslib\": \"^2.4.1\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"typescript\": \"^4.9.4\"\r\n  }\r\n}\r\n```\r\n\r\n`tsconfig.json`:\r\n```json\r\n{\r\n  \"compileOnSave\": false,\r\n  \"compilerOptions\": {\r\n    \"baseUrl\": \"./\",\r\n    \"outDir\": \"./dist\",\r\n    \"target\": \"ES2022\",  // \u003c----- !!!\r\n    \"module\": \"ES2022\",\r\n    \"strict\": true,\r\n    \"experimentalDecorators\": true,\r\n    \"useDefineForClassFields\": false,\r\n    \"lib\": [\r\n      \"ES2022\",\r\n      \"dom\"\r\n    ]\r\n  },\r\n  \"files\": [\r\n    \"src/index.ts\"\r\n  ]\r\n}\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\n~\\dist\\index.js:13\r\n    static { this.Default = new PingMessage_1(); } // [A]\r\n          ^\r\n\r\nTypeError: undefined is not a constructor\r\n at Function.\u003cstatic_initializer> (\\~\\dist\\index.js:13:29)\r\n at Object.\u003canonymous> (\\~\\dist\\index.js:12:19)\r\n at Module._compile (node:internal/modules/cjs/loader:1155:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)\r\n at Module.load (node:internal/modules/cjs/loader:1033:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:868:12)\r\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n at node:internal/main/run_main_module:22:47\r\n\r\n### 🙂 Expected behavior\r\n\r\nConsole.logs:\r\n\r\n```\r\nRegistring: \"PingMessage\"\r\nPing\r\n```\r\n","author":{"url":"https://github.com/vladimir-siv","@type":"Person","name":"vladimir-siv"},"datePublished":"2022-12-23T18:32:58Z","url":"https://github.com/microsoft/TypeScript/issues/52004"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c37bee00-bfd5-d3e9-18df-4d6110d03ce0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA45A:395430:BBF3B2:F9D374:6B00F0C7
html-safe-nonce9f9e4a42ada95c571f9e1552c998546400b31b20d7f2ed54208172d4baf325e1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDVBOjM5NTQzMDpCQkYzQjI6RjlEMzc0OjZCMDBGMEM3IiwidmlzaXRvcl9pZCI6IjI0NzM5MjgxNTgxNjA2NzkxMTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3da622a06b58c5d020c94ad8f9f4c40e537cd8e7a4bf9b342faa9ea7fe469203
hovercard-subject-tagissue:1509639007
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/52004/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e52cf16d5aabb7856a5ca578a7e7b4f1cfdced22ee85c2f8cf7527702d7a6626/microsoft/TypeScript/issues/52004
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e52cf16d5aabb7856a5ca578a7e7b4f1cfdced22ee85c2f8cf7527702d7a6626/microsoft/TypeScript/issues/52004
og:image:altBug Report Class decorators are not working properly when the class has a static field of the same type and is instantiating it statically. Seems like this only happens when targeting ES2022. 🔎 Sea...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevladimir-siv
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/52004#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F52004
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F52004
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/52004
Reloadhttps://github.com/microsoft/TypeScript/issues/52004
Reloadhttps://github.com/microsoft/TypeScript/issues/52004
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/52004
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/52004
#54046https://github.com/microsoft/TypeScript/pull/54046
ES2022 Class Decorators not working when Class has self-static memberhttps://github.com/microsoft/TypeScript/issues/52004#top
#54046https://github.com/microsoft/TypeScript/pull/54046
https://github.com/rbuckton
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
TypeScript 5.1.0https://github.com/microsoft/TypeScript/milestone/178
https://github.com/vladimir-siv
Vladimir Sivčev (vladimir-siv)https://github.com/vladimir-siv
on Dec 23, 2022https://github.com/microsoft/TypeScript/issues/52004#issue-1509639007
Bug repro in Playgroundhttps://www.typescriptlang.org/play?target=9&jsx=0&module=7&ts=5.0.0-dev.20221223#code/GYVwdgxgLglg9mABAWQKYGd0EMDmqAU0cATgFyIBi408YAlAFADeDAkBAunADaoB03ODnwADAEqocMdFGIwwOcgCIAJEyLE+YLAFtUAXyUi6Abgb6GDAAJpMuVAwjcsmRAAV5OW9jzM2ABxAAI24YCEQZLFhwgBFUYCwQbihyDwVve0QAXkQwVAB3d08MvHxTRAB6CsQAbQBBAF0A4NDwjjAZYhANfECQsMRiVCwAEwRuAE9EADUsbhBUck7PbMQlNJwlOkQmRAsLBiqi9IwffjiEpKhVvMKNkoJyo5qAISb2rl4BIXx70-s+BdEsk+LN5qhTJYjgBlfJYfz+FbySJgWBRWiIYDEOA6WqNRBQOC1N6DVBgEaoYjoAkAC2kiA4FMQ+RIAGtPHxDtVoahUDpqaFWagGZxZN1CcREPSwHBrhTgPJUCNmahuNxmXTeFKOlAsKiYOiFIgsBFddFEHodEFKcyYFA6Ug7dS4PkkE4XOhOUA
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Jan 4, 2023https://github.com/microsoft/TypeScript/issues/52004#event-8154812267
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Ron Buckton (rbuckton)https://github.com/rbuckton
on Jan 4, 2023https://github.com/microsoft/TypeScript/issues/52004#event-8154812571
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Jan 5, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1372676903
Ron Buckton (rbuckton)https://github.com/rbuckton
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Jan 5, 2023https://github.com/microsoft/TypeScript/issues/52004#event-8163488357
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Jan 5, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1372689174
https://github.com/vladimir-siv
Vladimir Sivčev (vladimir-siv)https://github.com/vladimir-siv
on Jan 5, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1372720388
https://github.com/markwhitfeld
Mark Whitfeld (markwhitfeld)https://github.com/markwhitfeld
on Jan 7, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1374635223
https://www.typescriptlang.org/play?target=9#code/GYVwdgxgLglg9mABBATgUwIZTQMRXAWwGEAbDAZ3IAoIMSS0UAuRcqFGMAcwBpkzKAJTTAW4ANZg4AdzABKRAG8AUIjXIE5OAwB0JOFyoADACSLa9RgF8mRvhAHlhwOQG5V69FBAokAcmA4OD93K2VlUEhYBEQAZUI0ABE0CDgULDSqORZSCnJk1PSoNKUPNS8fJCzEAF4APiVEK1DwhzzEAFUwABMUtKw0btzKUvVWKCwYCERsNlrkdAG8QmHqPy7ewoGhxz8+Db6iwdW3ZTDlAAF4giTDjJQs5TaRgv7sHfaVMbZJ6dmoeaoTDYZbERxUPyvI4fSh7RBQ7YnUJAAhttps://www.typescriptlang.org/play?target=9#code/GYVwdgxgLglg9mABBATgUwIZTQMRXAWwGEAbDAZ3IAoIMSS0UAuRcqFGMAcwBpkzKAJTTAW4ANZg4AdzABKRAG8AUIjXIE5OAwB0JOFyoADACSLa9RgF8mRvhAHlhwOQG5V69FBAokAcmA4OD93K2VlUEhYBEQAZUI0ABE0CDgULDSqORZSCnJk1PSoNKUPNS8fJCzEAF4APiVEK1DwhzzEAFUwABMUtKw0btzKUvVWKCwYCERsNlrkdAG8QmHqPy7ewoGhxz8+Db6iwdW3ZTDlAAF4giTDjJQs5TaRgv7sHfaVMbZJ6dmoeaoTDYZbERxUPyvI4fSh7RBQ7YnUJAA
Ron Buckton (@rbuckton)https://github.com/rbuckton
https://github.com/markwhitfeld
Mark Whitfeld (markwhitfeld)https://github.com/markwhitfeld
on Mar 2, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1451381647
Ron Buckton (@rbuckton)https://github.com/rbuckton
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Mar 2, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1452148784
Ron Buckton (@rbuckton)https://github.com/rbuckton
abovehttps://github.com/microsoft/TypeScript/issues/52004#issuecomment-1372689174
https://github.com/markwhitfeld
Mark Whitfeld (markwhitfeld)https://github.com/markwhitfeld
on Mar 8, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1460904206
Ron Buckton (@rbuckton)https://github.com/rbuckton
herehttps://github.com/microsoft/TypeScript/commit/1bb96555da2d6cfd0a0b5d7e6357ea50ce5c95d1
issuehttps://github.com/microsoft/TypeScript/issues/5386
#52004 (comment)https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1461442819
https://github.com/markwhitfeld
Mark Whitfeld (markwhitfeld)https://github.com/markwhitfeld
on Mar 8, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1460919460
#52004 (comment)https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1461442819
https://github.com/markwhitfeld
Mark Whitfeld (markwhitfeld)https://github.com/markwhitfeld
on Mar 9, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1461442819
See herehttps://www.typescriptlang.org/play?target=9&ts=4.9.5#code/GYVwdgxgLglg9mABDMMoAoIEMA2OCmATgFyIDOUhKA5gDSIQ5ZlkBK+wpAYuNPGAEpEAbwBQiCQwRk4BAHQ441dAAMAkkhRoYuGGSL0yACzggcAE0QAjfIgDkAEmHY8RAL53iK+o2ZsOiABkgQxMLOzAcmBYALb4AgDc4pKE+FAghEi+4RxJbqKioJCwCIjmcABycFBGNOjAYNy8JYIikojJEqnpmYgNeQVFfKUAynBxACL4EHCEWFCz6AKkAMJhZFMzcwuEIp1SYDLyisp2ahVqACqIm7Pzs3aJ+90ZSOhQWITUaaRYYACey0Qf3+iAAvAA+Nr7dozQ6yfAKJToOy3bY0UJ+Yh2egfL5pKKxeJJdrtF69bJkRAAdTmAAc6fhLPgAB5QfBgcxUvHfKAifLtNwDURwo6Ik4osFSm7TJhUMDUUgAeSo1BQuEeSVEAAExpNpncdksRetECqYGrojg9u0KPMYBBEOyKABGcHIVAYOzmy0a+g+9U4J62j6wR3OqAAJndAatJMkdrDTvwFAAzEs2uSkLHcAlEAKE6GHcmKAAWd3lKo1OpDFqIDPCRBZs2qwP54OF+3hlNQACsMdbVoA-HII6WlsLRQikacALTzxAAQWA7N2mzl9oQhhMZksNhp9MZ5mx-sHuEJcSeU+OyJUdgjLrs5B3FmsthzOC8p4tgdHPZdI7RJeSTXuKt73j2kZPsYpivvuH5fi2P5Wn+FCRoBRJXtI04SneEbpgI0EvpYza0lgDJMohH6oVABEYcBIrYTeyh4T246Ec+sEkWkrwHuRR5UWeOA0ex9HEox8LMaoEEUL2RFcW+SG+p+3hKb+Ea9mJiRAA
run using ES2021https://www.typescriptlang.org/play?target=8&ts=4.9.5#code/GYVwdgxgLglg9mABDMMoAoIEMA2OCmATgFyIDOUhKA5gDSIQ5ZlkBK+wpAYuNPGAEpEAbwBQiCQwRk4BAHQ441dAAMAkkhRoYuGGSL0yACzggcAE0QAjfIgDkAEmHY8RAL53iK+o2ZsOiABkgQxMLOzAcmBYALb4AgDc4pKE+FAghEi+4RxJbqKioJCwCIjmcABycFBGNOjAYNy8JYIikojJEqnpmYgNeQVFfKUAynBxACL4EHCEWFCz6AKkAMJhZFMzcwuEIp1SYDLyisp2ahVqACqIm7Pzs3aJ+90ZSOhQWITUaaRYYACey0Qf3+iAAvAA+Nr7dozQ6yfAKJToOy3bY0UJ+Yh2egfL5pKKxeJJdrtF69bJkRAAdTmAAc6fhLPgAB5QfBgcxUvHfKAifLtNwDURwo6Ik4osFSm7TJhUMDUUgAeSo1BQuEeSVEAAExpNpncdksRetECqYGrojg9u0KPMYBBEOyKABGcHIVAYOzmy0a+g+9U4J62j6wR3OqAAJndAatJMkdrDTvwFAAzEs2uSkLHcAlEAKE6GHcmKAAWd3lKo1OpDFqIDPCRBZs2qwP54OF+3hlNQACsMdbVoA-HII6WlsLRQikacALTzxAAQWA7N2mzl9oQhhMZksNhp9MZ5mx-sHuEJcSeU+OyJUdgjLrs5B3FmsthzOC8p4tgdHPZdI7RJeSTXuKt73j2kZPsYpivvuH5fi2P5Wn+FCRoBRJXtI04SneEbpgI0EvpYza0lgDJMohH6oVABEYcBIrYTeyh4T246Ec+sEkWkrwHuRR5UWeOA0ex9HEox8LMaoEEUL2RFcW+SG+p+3hKb+Ea9mJiRAA
run using ES2022https://www.typescriptlang.org/play?target=9&ts=4.9.5#code/GYVwdgxgLglg9mABDMMoAoIEMA2OCmATgFyIDOUhKA5gDSIQ5ZlkBK+wpAYuNPGAEpEAbwBQiCQwRk4BAHQ441dAAMAkkhRoYuGGSL0yACzggcAE0QAjfIgDkAEmHY8RAL53iK+o2ZsOiABkgQxMLOzAcmBYALb4AgDc4pKE+FAghEi+4RxJbqKioJCwCIjmcABycFBGNOjAYNy8JYIikojJEqnpmYgNeQVFfKUAynBxACL4EHCEWFCz6AKkAMJhZFMzcwuEIp1SYDLyisp2ahVqACqIm7Pzs3aJ+90ZSOhQWITUaaRYYACey0Qf3+iAAvAA+Nr7dozQ6yfAKJToOy3bY0UJ+Yh2egfL5pKKxeJJdrtF69bJkRAAdTmAAc6fhLPgAB5QfBgcxUvHfKAifLtNwDURwo6Ik4osFSm7TJhUMDUUgAeSo1BQuEeSVEAAExpNpncdksRetECqYGrojg9u0KPMYBBEOyKABGcHIVAYOzmy0a+g+9U4J62j6wR3OqAAJndAatJMkdrDTvwFAAzEs2uSkLHcAlEAKE6GHcmKAAWd3lKo1OpDFqIDPCRBZs2qwP54OF+3hlNQACsMdbVoA-HII6WlsLRQikacALTzxAAQWA7N2mzl9oQhhMZksNhp9MZ5mx-sHuEJcSeU+OyJUdgjLrs5B3FmsthzOC8p4tgdHPZdI7RJeSTXuKt73j2kZPsYpivvuH5fi2P5Wn+FCRoBRJXtI04SneEbpgI0EvpYza0lgDJMohH6oVABEYcBIrYTeyh4T246Ec+sEkWkrwHuRR5UWeOA0ex9HEox8LMaoEEUL2RFcW+SG+p+3hKb+Ea9mJiRAA
tweaked JS output code (playground)https://www.typescriptlang.org/play?target=9&ts=4.9.5&filetype=js#code/EQVwzgpgBGAuBOBLAxrYBuAUANwIbygH1CATCZAe3l1mgF4oAKWAC0TCgDJOpX2A6YmUrVaASigAfSVABmIAHapEFBU2FUaVMABpe+AOYRYegNYQAnnrJhkEgN6YozqHgLIoDQyAC2EBbBg-AA2-gasegQMHgA8UADMUAD8+vBGsFAAXFA2HnT5UAogwcHJORC2nlAA8gBGAFbksPzp1QDuCgAK8BQADhDwsBYAIhXISL2wVMyGxmaWEtm51lguUIiyTEP9FJsAShCyoaieBcAUDU3AXDzbELtQB0dN-Bqi9GfySrAqCsASUUeh2OzTeNAgjDBU3gulS6XmVnKtjEqxcEGCkDkVCYbnWVSh2hCYVYUAAtFAAIzoPEAPgYAAZqYhSaSJBt1PjyJpoWAANqIAC6AKqjFiCTKJEY8EWUA8NPFKUlsFmJig5kR0qyORmaTmaoWEmkUHgqOc8GMIHgajl4u4xpuNUuqFeh0QCgg3T6AyGOvh+o1YkiWAAvlhcdUkAY3bhgoQqZgvspVOsFIhYKKY6F4HpkMFcGAwE8HE4XJQFGAKKEQhQDIwAAYASTUbrTiBj7AGejALAoxRIUFq0AA5AASezITMDYNDzJ1nN5gtPB25-OFw78BS4Pwoktmi1W2ULteyEMJxRJtQkCgAOQofAUtdkCmLa3NsEtaifp8TP2TAGUKD8UYRC0eBGBfUtVArKtghrRghwba8GwAFSgYDuSoIcd1ffc1F9YwJDoeVHDWNYy2giBq1rId0NEN0DEPVdMiHPRlV1ZpN23U1SLfD9GILKAAHVqF6fp+wgAAPWgFBIDg2PSKASNI5xQ13KBVODTByMrSjYOo-IGGAvMkAfbII0QKNN2CLCsFCDJzMsmMqgc6NYwpKoVwElyrMUtS4BoFBFJqSNXLjKo+DAalgygAB6GKoBiFkoE6PZqk6ao-wAQQAGSgZDqigTLhmGPKAAkGz-KBssQgBRPzlR+Dx7F4NggloOB3IYFt0yHbyYxY4KLNCikUXU+qAqalqBHa2AACZnJCqy4yi8bGt4CpYHicCgt4g8+rcla1n8tbmoi-gZoAFnxG87zYB9GB-X4mAcY1cMGxyDvU0bNKOhrAtO1rzo2gBWBahqWikkiBuALvAlbVP2sGPrChghC5d5GF5NSAKA9HQPAzABT0fad20mC4KHFlyUy2RaAIIz8AC1Qux7PsB2gYTcFEiASGY4nFpjDctwgUmoJ0qj6yHGaKSHGBWeCftB3e1zZ358HBelqHOJFrAyd0uC6yljbZtl7tewV9nlas1WrY142teF0Xy3FvTJZmraxFN+X+12tROe53m51t4Joc28CHa4rSxfJ2tDcu8CvfNn23v9sSbf20PYbECOdaj52Y7dkHE7ZpX9vTgWQ5m4Gc53IA
Ron Buckton (@rbuckton)https://github.com/rbuckton
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 5.1.0https://github.com/microsoft/TypeScript/milestone/178
on Mar 14, 2023https://github.com/microsoft/TypeScript/issues/52004#event-8746290475
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Apr 27, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1526460565
Ron Buckton (@rbuckton)https://github.com/rbuckton
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Apr 27, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1526464828
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
on Apr 27, 2023https://github.com/microsoft/TypeScript/issues/52004#event-9118936598
Ron Buckton (rbuckton)https://github.com/rbuckton
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#54046https://github.com/microsoft/TypeScript/pull/54046
on Apr 28, 2023https://github.com/microsoft/TypeScript/issues/52004#event-9127931883
https://github.com/gkurt
Gokhan Kurt (gkurt)https://github.com/gkurt
on May 8, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1538945967
https://github.com/markwhitfeld
Mark Whitfeld (markwhitfeld)https://github.com/markwhitfeld
on May 10, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1542073082
https://github.com/lalo-mx
Eduardo Quintanilla (lalo-mx)https://github.com/lalo-mx
on Jun 2, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1573811354
angular/angular#49415https://github.com/angular/angular/issues/49415
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jun 2, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1574001171
https://github.com/russcarver
Russ Carver (russcarver)https://github.com/russcarver
on Sep 15, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1720675890
https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3
https://github.com/ericrovtar
Eric Rovtar (ericrovtar)https://github.com/ericrovtar
on Dec 4, 2023https://github.com/microsoft/TypeScript/issues/52004#issuecomment-1839438610
https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3
https://github.com/iqaan
iqaan (iqaan)https://github.com/iqaan
on Mar 26, 2025https://github.com/microsoft/TypeScript/issues/52004#issuecomment-2753531582
microsofthttps://github.com/microsoft
on Oct 22, 2025https://github.com/microsoft/TypeScript/issues/52004#event-20417643319
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/52004
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/52004
Ron Buckton (rbuckton)https://github.com/rbuckton
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
TypeScript 5.1.0https://github.com/microsoft/TypeScript/milestone/178
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.