Title: Isolated declarations uses type information when emitting computed object keys · Issue #58533 · microsoft/TypeScript · GitHub
Open Graph Title: Isolated declarations uses type information when emitting computed object keys · Issue #58533 · microsoft/TypeScript
X Title: Isolated declarations uses type information when emitting computed object keys · Issue #58533 · microsoft/TypeScript
Description: 🔎 Search Terms isolated declarations computed keys object literals 🕗 Version & Regression Information 5.5.0-dev.20240514 ⏯ Playground Link https://www.typescriptlang.org/play/?isolatedDeclarations=true&ts=5.5.0-dev.20240514#code/KYDwDg9g...
Open Graph Description: 🔎 Search Terms isolated declarations computed keys object literals 🕗 Version & Regression Information 5.5.0-dev.20240514 ⏯ Playground Link https://www.typescriptlang.org/play/?isolatedDeclarations=...
X Description: 🔎 Search Terms isolated declarations computed keys object literals 🕗 Version & Regression Information 5.5.0-dev.20240514 ⏯ Playground Link https://www.typescriptlang.org/play/?isolatedDeclarati...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/58533
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Isolated declarations uses type information when emitting computed object keys ","articleBody":"### 🔎 Search Terms\n\n- isolated declarations\r\n- computed keys\r\n- object literals\n\n### 🕗 Version \u0026 Regression Information\n\n5.5.0-dev.20240514\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?isolatedDeclarations=true\u0026ts=5.5.0-dev.20240514#code/KYDwDg9gTgLgBAYwgOwM7wNLAJ5wLxwBEMAFsFtoQNwBQNAJsAgDYCGUwcA5sxAEatmcAN4044uKEixEKdHADivAcwr4ipYEv6CKhMRKnR4SNPACqyAJYBHAK7AAytgC2fCMwBccO9fudUV3dmWglJcGNZMzgAORRLWwdnNw9vQJSQmgBfOiMZU3kAQXVRMIBtCgBdbxgoBwAaA3Ey5OCAOhgIR1qrZC4AFVYuargAM0FUYEbyhP9WjxHx5knpiTLtFSrvJZXsmiA\n\n### 💻 Code\n\n```ts\r\nexport const Key = \"theKey\";\r\n\r\ndeclare global {\r\n export const GlobalKey = \"theGlobalKey\"\r\n export const UniqueSymbol: unique symbol;\r\n export const NonUniqueSymbol: symbol;\r\n}\r\n\r\nexport const A = {\r\n [Key]: true,\r\n [Symbol.toStringTag]: false,\r\n [UniqueSymbol]: false,\r\n [GlobalKey]: false,\r\n}\r\n```\r\n\n\n### 🙁 Actual behavior\n\nTypeScript is emitting the computed property keys with type information that can not be determined without a type checker.\r\n\r\n```ts\r\nexport declare const Key = \"theKey\";\r\ndeclare global {\r\n export const GlobalKey = \"theGlobalKey\";\r\n export const UniqueSymbol: unique symbol;\r\n export const NonUniqueSymbol: symbol;\r\n}\r\nexport declare const A: {\r\n theKey: boolean;\r\n [Symbol.toStringTag]: boolean;\r\n [UniqueSymbol]: boolean;\r\n theGlobalKey: boolean;\r\n};\r\n```\n\n### 🙂 Expected behavior\n\n```ts\r\nexport declare const Key = \"theKey\";\r\ndeclare global {\r\n export const GlobalKey = \"theGlobalKey\";\r\n export const UniqueSymbol: unique symbol;\r\n export const NonUniqueSymbol: symbol;\r\n}\r\nexport declare const A: {\r\n [Key]: true,\r\n [Symbol.toStringTag]: false,\r\n [UniqueSymbol]: false,\r\n [GlobalKey]: false,\r\n};\r\n```\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/lucacasonato","@type":"Person","name":"lucacasonato"},"datePublished":"2024-05-14T15:16:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/58533/TypeScript/issues/58533"}
| 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:c0708658-a5b6-ed8e-a783-d473d32f92f1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99F8:1BD00F:323315:43F151:6A61380C |
| html-safe-nonce | 406fad0cd4c7d49788b4348e0d2f6227dd3890ddf9e6b4749dcc6e0866a5fcc8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUY4OjFCRDAwRjozMjMzMTU6NDNGMTUxOjZBNjEzODBDIiwidmlzaXRvcl9pZCI6IjQ3NDk1MzI1NzQ2NzA0NjkxMzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 055c67ed8905d4216f8cad27da3b71385201759b43aa47f187a2971ff69b5032 |
| hovercard-subject-tag | issue:2295762526 |
| 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/58533/issue_layout |
| twitter:image | https://opengraph.githubassets.com/39b3509d7a5adbb056448eb631156a66d85dcd9dcfb68ed311845295e26ffdfe/microsoft/TypeScript/issues/58533 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/39b3509d7a5adbb056448eb631156a66d85dcd9dcfb68ed311845295e26ffdfe/microsoft/TypeScript/issues/58533 |
| og:image:alt | 🔎 Search Terms isolated declarations computed keys object literals 🕗 Version & Regression Information 5.5.0-dev.20240514 ⏯ Playground Link https://www.typescriptlang.org/play/?isolatedDeclarations=... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lucacasonato |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b7a3d1e6770dc7153450d820fcfe9a7851c4cf2251dcc29c7ad3c5cd1b9e88b |
| 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 | 78cf9d43f120d1f03636ca22ab420bcbb1712804 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width