Title: Documentation: literal "types" · Issue #18102 · microsoft/TypeScript · GitHub
Open Graph Title: Documentation: literal "types" · Issue #18102 · microsoft/TypeScript
X Title: Documentation: literal "types" · Issue #18102 · microsoft/TypeScript
Description: Code Try the following out at https://www.typescriptlang.org/play/index.html (sadly, this is too long to include a sharable link) let num1: 1; let num2: 2; let num3: typeof num2; num3 = num2; num3 = num1; Expected behavior: This works ex...
Open Graph Description: Code Try the following out at https://www.typescriptlang.org/play/index.html (sadly, this is too long to include a sharable link) let num1: 1; let num2: 2; let num3: typeof num2; num3 = num2; num3 ...
X Description: Code Try the following out at https://www.typescriptlang.org/play/index.html (sadly, this is too long to include a sharable link) let num1: 1; let num2: 2; let num3: typeof num2; num3 = num2; num3 ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/18102
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Documentation: literal \"types\"","articleBody":"**Code**\r\n\r\nTry the following out at https://www.typescriptlang.org/play/index.html (sadly, this is too long to include a sharable link)\r\n```ts\r\nlet num1: 1;\r\nlet num2: 2;\r\nlet num3: typeof num2;\r\nnum3 = num2;\r\nnum3 = num1;\r\n```\r\n\r\n**Expected behavior:**\r\nThis works exactly as expected, such that there's an error on the second assignment to num3. \r\n\r\nI don't easily see something in your doc that mentions this is possible. It is probably implicit in various places, as it is particularly useful with some unions. Seems like calling this out explicitly would be valuable?\r\n","author":{"url":"https://github.com/bodawei","@type":"Person","name":"bodawei"},"datePublished":"2017-08-29T04:46:09Z","url":"https://github.com/microsoft/TypeScript/issues/18102"}
| 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:782942a5-1ab8-daf5-c47f-405231d7cd99 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 92EA:1506BA:2301F4:30E03D:6AFBE29B |
| html-safe-nonce | e13cf4d6f5e90cbc66a8a736fe215875656bf7cfd5519cfc576949123a066783 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkVBOjE1MDZCQToyMzAxRjQ6MzBFMDNEOjZBRkJFMjlCIiwidmlzaXRvcl9pZCI6IjYyOTMwNTI1MjcwMzgxNjE1NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 488e8d28feddcabe68948081bc5ec78674d57023b25abea0fc0c4f2975c80591 |
| hovercard-subject-tag | issue:253528210 |
| 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/18102/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c391d4d25b74bb19c9a7b7acb78604f7dc19b1a2ebf9aba2b99cebf5046a9a71/microsoft/TypeScript/issues/18102 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c391d4d25b74bb19c9a7b7acb78604f7dc19b1a2ebf9aba2b99cebf5046a9a71/microsoft/TypeScript/issues/18102 |
| og:image:alt | Code Try the following out at https://www.typescriptlang.org/play/index.html (sadly, this is too long to include a sharable link) let num1: 1; let num2: 2; let num3: typeof num2; num3 = num2; num3 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bodawei |
| hostname | github.com |
| expected-hostname | github.com |
| None | 744d4381b1c4dbd6d8736c7d7e5bbe7dc11217584e457a3555020c631764e8ec |
| 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 | df859c48a4c8b4c0009c19bb4e82101aacb4b998 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width