Title: `unique symbol`s from the global `SymbolConstructor` widen way too eagerly · Issue #53276 · microsoft/TypeScript · GitHub
Open Graph Title: `unique symbol`s from the global `SymbolConstructor` widen way too eagerly · Issue #53276 · microsoft/TypeScript
X Title: `unique symbol`s from the global `SymbolConstructor` widen way too eagerly · Issue #53276 · microsoft/TypeScript
Description: Given const a = Symbol.toStringTag; class F { [a](){ return "" } } (new F())[a]; we currently issue a Element implicitly has an 'any' type because expression of type 'symbol' can't be used to index type 'F'.(7053) error on the access. Th...
Open Graph Description: Given const a = Symbol.toStringTag; class F { [a](){ return "" } } (new F())[a]; we currently issue a Element implicitly has an 'any' type because expression of type 'symbol' can't be used to index...
X Description: Given const a = Symbol.toStringTag; class F { [a](){ return "" } } (new F())[a]; we currently issue a Element implicitly has an 'any' type because expression of type 'symbol...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/53276
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`unique symbol`s from the global `SymbolConstructor` widen way too eagerly","articleBody":"Given\r\n```ts\r\nconst a = Symbol.toStringTag;\r\n\r\nclass F {\r\n [a](){ return \"\" }\r\n}\r\n\r\n(new F())[a];\r\n```\r\nwe currently issue a `Element implicitly has an 'any' type because expression of type 'symbol' can't be used to index type 'F'.(7053)` error on the access.\r\n\r\nThere should be no errors, as with\r\n```ts\r\nconst a = Symbol();\r\n\r\nclass F {\r\n [a](){ return \"\" }\r\n}\r\n\r\n(new F())[a];\r\n```\r\nsince `Symbol.toStringTag` is a `unique symbol` just like what `Symbol()` makes.","author":{"url":"https://github.com/weswigham","@type":"Person","name":"weswigham"},"datePublished":"2023-03-15T22:10:36Z","url":"https://github.com/microsoft/TypeScript/issues/53276"}
| 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:47bfdd5a-4f49-7e11-191f-5614979f5c8f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F5E:245336:9289FA:C7BA1D:6B04802D |
| html-safe-nonce | 36b8bd585486a9fd7a3eb9145c84295a8ffdadda7be4e8ca9563ac2b6afc577d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjVFOjI0NTMzNjo5Mjg5RkE6QzdCQTFEOjZCMDQ4MDJEIiwidmlzaXRvcl9pZCI6IjUxOTc1NDE4NDE2ODc1NzY2MjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 603bf11dd4b0a4a650eab821edf71230797e5715345424f790dede487a885cec |
| hovercard-subject-tag | issue:1626357572 |
| 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/53276/issue_layout |
| twitter:image | https://opengraph.githubassets.com/464576cd08dbb81c614c8a2a74d6aa62bf21add6501e3c83839c0e7cdac1dc37/microsoft/TypeScript/issues/53276 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/464576cd08dbb81c614c8a2a74d6aa62bf21add6501e3c83839c0e7cdac1dc37/microsoft/TypeScript/issues/53276 |
| og:image:alt | Given const a = Symbol.toStringTag; class F { [a](){ return "" } } (new F())[a]; we currently issue a Element implicitly has an 'any' type because expression of type 'symbol' can't be used to index... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | weswigham |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511 |
| 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 | ed3f2e01f6b7672780c586c8af0e72726374d7b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width