Title: Design Meeting Notes, 2/21/2020 · Issue #36946 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 2/21/2020 · Issue #36946 · microsoft/TypeScript
X Title: Design Meeting Notes, 2/21/2020 · Issue #36946 · microsoft/TypeScript
Description: Update on Reducing Impossible Intersections #28663 Better errors because a bunch of empty intersections A couple of failures on DefinitelyTyped 2 are legit: trying to access properties or extend from an empty intersection 1 thing that fa...
Open Graph Description: Update on Reducing Impossible Intersections #28663 Better errors because a bunch of empty intersections A couple of failures on DefinitelyTyped 2 are legit: trying to access properties or extend fr...
X Description: Update on Reducing Impossible Intersections #28663 Better errors because a bunch of empty intersections A couple of failures on DefinitelyTyped 2 are legit: trying to access properties or extend fr...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/36946
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 2/21/2020","articleBody":"# Update on Reducing Impossible Intersections\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/28663\r\n\r\n* Better errors because a bunch of empty intersections\r\n* A couple of failures on DefinitelyTyped\r\n * 2 are legit: trying to access properties or extend from an empty intersection\r\n * 1 thing that failed was Ramda\r\n * Uses ts-toolbelt\r\n * Depends on `keyof (A & B)` being the same as `(keyof A) | (keyof B)`, which is still true except for when the intersection is empty.\r\n * If `A & B` more-often reduces to `never` (the proposed change), then `keyof (A & B)` *should* become `keyof never`.\r\n * Fixable by sending a PR to ts-toolbelt - but that doesn't necessarily mean that other things won't break.\r\n* How can a user diagnose the `keyof (A & B)` being the same as `keyof never` (being the same as `never`)?\r\n * We special-cased to print back `never` for `A & B`.\r\n * We need to ensure that `A & B` doesn't leak - it has to be an implementation detail.\r\n * Are the updates for that finite and known.\r\n* Conclusion: probably good to go, @ahejlsberg will need to ensure we have consistent behavior during type argument inference.\r\n\r\n# Permitting Deeply Nested Conditionals\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/28663\r\n\r\n* Two \"competing\" solutions\r\n * By flattening: https://github.com/microsoft/TypeScript/pull/36583\r\n * By adjusting the instantiation count: https://github.com/microsoft/TypeScript/pull/36584\r\n* For each of these, we just keep diving into each conditional and increment the type instantiation counter, which eventually triggers the type limiter.\r\n* A lot of people's mental model is that each layer of the conditional belongs to one over-arching construct.\r\n * So the idea of https://github.com/microsoft/TypeScript/pull/36583 is to just treat the whole structure of conditionals as one big ol' type to operate on at once.\r\n * Really helps all nested conditionals in the `false` branches.\r\n * We've talked about type switches, but that's just the same as a bunch of nested conditional types.\r\n* The limitation is that this the first approach is limited to *syntactically* nested conditional types.\r\n * Lots of cases where there are conditionals with type aliases to each other.\r\n * So there's a broader problem.\r\n * Also, would the original change mean we would never cache the deeper conditional?\r\n * No, you only need to cache at the top level.\r\n * But that's not true for the type aliases case.\r\n * But we only \"optimize\" here for the syntactic case - otherwise we *will* cache.\r\n* Can we combine these approaches? e.g. optimize for syntactic cases and then still avoid triggering the depth increment cases.\r\n * Seems like yes.\r\n* Also, this code looks like people are trying to discriminate on types - would there be some optimizations?\r\n* These both help pathological cases - does it impact the simple case?\r\n* Conclusion: @weswigham and @ahejlsberg to work together and explore combining both approaches.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2020-02-21T22:25:24Z","url":"https://github.com/microsoft/TypeScript/issues/36946"}
| 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:6cdbcd04-738a-5d75-2e0c-3afd0b1816c3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8424:3F4253:29EB8FC:37DB459:6B01BEF8 |
| html-safe-nonce | 3d2a8aa5b6964e4b22d7044aa7e6506c11e68d1048727f550acdc6dc5a2b44ce |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDI0OjNGNDI1MzoyOUVCOEZDOjM3REI0NTk6NkIwMUJFRjgiLCJ2aXNpdG9yX2lkIjoiODA4NjcxMTM4NzYwMDA0Mzc2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ab07ebea934c4f59dc1426561d25f429b56d539fe1f5c766f1e9396c583f9c60 |
| hovercard-subject-tag | issue:569215309 |
| 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/36946/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b9e6f6f4754665382a3537c9a7f4d4598936c19ae809f2e0a15869ec8bab1a5/microsoft/TypeScript/issues/36946 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b9e6f6f4754665382a3537c9a7f4d4598936c19ae809f2e0a15869ec8bab1a5/microsoft/TypeScript/issues/36946 |
| og:image:alt | Update on Reducing Impossible Intersections #28663 Better errors because a bunch of empty intersections A couple of failures on DefinitelyTyped 2 are legit: trying to access properties or extend fr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width