Title: Ternary results consider both branches even when boolean literal values make one impossible · Issue #14206 · microsoft/TypeScript · GitHub
Open Graph Title: Ternary results consider both branches even when boolean literal values make one impossible · Issue #14206 · microsoft/TypeScript
X Title: Ternary results consider both branches even when boolean literal values make one impossible · Issue #14206 · microsoft/TypeScript
Description: TypeScript Version: 2.3.0-dev.20170217 Code const aOrB = true ? 'a' : 'B'; const a: 'a' = aOrB; Expected behavior: Compiles without error. Actual behavior: Type '"a" | "B"' is not assignable to type '"a"'. Type '"B"' is not assignable to...
Open Graph Description: TypeScript Version: 2.3.0-dev.20170217 Code const aOrB = true ? 'a' : 'B'; const a: 'a' = aOrB; Expected behavior: Compiles without error. Actual behavior: Type '"a" | "B"' is not assignable to typ...
X Description: TypeScript Version: 2.3.0-dev.20170217 Code const aOrB = true ? 'a' : 'B'; const a: 'a' = aOrB; Expected behavior: Compiles without error. Actual behavior: Type '"a...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/14206
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ternary results consider both branches even when boolean literal values make one impossible","articleBody":"**TypeScript Version:** 2.3.0-dev.20170217\r\n\r\n**Code**\r\n\r\n```ts\r\nconst aOrB = true ? 'a' : 'B';\r\nconst a: 'a' = aOrB;\r\n```\r\n\r\n**Expected behavior:**\r\nCompiles without error.\r\n\r\n**Actual behavior:**\r\n>Type '\"a\" | \"B\"' is not assignable to type '\"a\"'.\r\n> Type '\"B\"' is not assignable to type '\"a\"'.","author":{"url":"https://github.com/krryan","@type":"Person","name":"krryan"},"datePublished":"2017-02-21T16:18:38Z","url":"https://github.com/microsoft/TypeScript/issues/14206"}
| 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:8dbbf1a7-4e5a-5ff0-8cdc-47ac4ceb655e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C326:134361:CB089B:10C70F7:6B00F5B3 |
| html-safe-nonce | 006f4f6778e37f4598854be960a2d63da7247cd3fd672c78bebc5f7395d23580 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzI2OjEzNDM2MTpDQjA4OUI6MTBDNzBGNzo2QjAwRjVCMyIsInZpc2l0b3JfaWQiOiI0NTcwNjgzNjg0NDExNzc1MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0f40993d204fdb1288560e639d2a47e22a2f3353704da982e84a7c5ccd5a5cb8 |
| hovercard-subject-tag | issue:209195262 |
| 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/14206/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a780350f107c9b1fe93b4b7fd08f775858ab959c79e360ece263fff8b57ea849/microsoft/TypeScript/issues/14206 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a780350f107c9b1fe93b4b7fd08f775858ab959c79e360ece263fff8b57ea849/microsoft/TypeScript/issues/14206 |
| og:image:alt | TypeScript Version: 2.3.0-dev.20170217 Code const aOrB = true ? 'a' : 'B'; const a: 'a' = aOrB; Expected behavior: Compiles without error. Actual behavior: Type '"a" | "B"' is not assignable to typ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | krryan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width