Title: Design Meeting Notes, 4/15/2019 · Issue #30947 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 4/15/2019 · Issue #30947 · microsoft/TypeScript
X Title: Design Meeting Notes, 4/15/2019 · Issue #30947 · microsoft/TypeScript
Description: The non-inferrable type #30856 In resolveCallExpression, there's a big ol' comment with some context ("When a call to a generic function"). We have this thing called the anyFunctionType, which signals that we are trying to defer inferrin...
Open Graph Description: The non-inferrable type #30856 In resolveCallExpression, there's a big ol' comment with some context ("When a call to a generic function"). We have this thing called the anyFunctionType, which sign...
X Description: The non-inferrable type #30856 In resolveCallExpression, there's a big ol' comment with some context ("When a call to a generic function"). We have this thing called the anyFuncti...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/30947
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 4/15/2019","articleBody":"# The non-inferrable type\r\n\r\nhttps://github.com/Microsoft/TypeScript/pull/30856\r\n\r\n* In `resolveCallExpression`, there's a big ol' comment with some context (\"When a call to a generic function\").\r\n* We have this thing called the `anyFunctionType`, which signals that we are trying to defer inferring from contextually-sensitive function expressions.\r\n* We have situations like the following:\r\n\r\n ```ts\r\n outer(..., ..., inner(x => ...), ...);\r\n ```\r\n * `inner` could have a type like `\u003cT>(x: T) => T`\r\n * We need to defer the call to `inner` for the same reason, but we need some sort of marker type like `anyFunctionType` that isn't technically a function type.\r\n * It's extremely subtle, but there were issues in Ramda where this occurred.\r\n * @weswigham \r\n* Causes some breaks *other* breaks on DT.\r\n* On the whole, this is a specialization of work where we were previously using a `silentNeverType`.\r\n\r\n# Excess property checking when relating to intersections and unions\r\n\r\nhttps://github.com/Microsoft/TypeScript/pull/30853\r\n\r\n* Many long-standing issues around excess property checking.\r\n* In principle, an object with *more* properties than is expected is \"fine\" - basic \"width\" subtyping.\r\n* But usually it's an error when people pass object literals - so we added excess property checks for options bags.\r\n * Aside: also did overlap checks for weak types for similar reasons.\r\n* Problem is, we do this on the top-level of relationship checks, but don't do it on nested properties of intersection types\r\n* Gets more \"interesting\" when you do excess properties on unions.\r\n * If assigning an `{ a, b, c, d }` object literal to `{ a, b } | { c, d }`, it's *plausible*\r\n * Probably not an `{ a, b, c, d, e }` though.\r\n * @weswigham, why again? Something about discriminant types.\r\n* Opened about 18 PRs in DefinitelyTyped for questionable tests, entirely missing declarations, or completely wrong declarations.\r\n* Error messages got a lot shorter too.\r\n* Weirdly, we found errors on code for `SomeOptions | object`.\r\n * It's a nonsense type...but is it wrong to report errors on it?\r\n * It legitimately caught bad stuff being passed!\r\n* This is a breaking change. ☹\r\n * None of the changes should feel \"debatable\" given how 3.4 went.\r\n* We need to make a call on `SomeOptions | object` being excess-property checked the same as `SomeOptions`.\r\n * It really does seem reasonable.\r\n* Assigning `{ b, c, d }` to `{ a, b } | { b, c }`.\r\n * Only works if you're assignable to the union without excess property checking anyway.\r\n * We could expand excess property checking to go deeper in the union - but this is future work.\r\n* Resolution: pull it in.\r\n\r\n# Make the `Omit` type stricter\r\n\r\nhttps://github.com/Microsoft/TypeScript/pull/30825\r\n\r\n* Would it be more irritating to use `Omit` if it has a constraint?\r\n * Adding a constraint would force users to add an explicit constraint where *they* use it.\r\n* DefinitelyTyped is mixed in `Omit` that is constrained and unconstrained - not entirely clear whether it's just one or the other.\r\n * https://github.com/DefinitelyTyped/DefinitelyTyped/search?p=6&q=%22type+Omit%22&unscoped_q=%22type+Omit%22\r\n* Languages like Rust propagate the constraints outwards.\r\n * Might be weird that a `T` with no constraint gains an implicit constraint.\r\n * But maybe not that weird?\r\n* Resolution: not worth breaking half the usages of `Omit` in the wild.\r\n\r\n# `keyof` on `unknown` and `never`\r\n\r\nhttps://github.com/Microsoft/TypeScript/pull/30753\r\n\r\n* Today:\r\n * `keyof unknown` is `never`.\r\n * `keyof never` is also `never`.\r\n* But `keyof` is contravariant in its bounds with respect to its operand.\r\n * `keyof` on `never` should be `unknown`\r\n * But can only really be `PropertyKey` (a.k.a. `keyof any`).\r\n* So change is that `keyof never` is now `keyof any`.\r\n* Aside: funny that `keyof keyof never` isn't `never`.\r\n* Resolution: Seems reasonable.\r\n","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2019-04-16T00:11:30Z","url":"https://github.com/microsoft/TypeScript/issues/30947"}
| 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:7a2b945a-b71c-4206-286d-2445d1d9195e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEF4:7A60E:A8E7D5:DBCB91:6B00E7A5 |
| html-safe-nonce | bff4025ff325aecd3f6760643cb590ed51823ac4002c2846e1bc43109e3030d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUY0OjdBNjBFOkE4RTdENTpEQkNCOTE6NkIwMEU3QTUiLCJ2aXNpdG9yX2lkIjoiNzUxODM4NTYzODM2MjYzODI0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a0c0257583f803da3acdd2a2d2db9116e552747972e303d04243e6d24d5c42af |
| hovercard-subject-tag | issue:433528721 |
| 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/30947/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a0b4081898bd80094616b3786c3135a5b065c2a311a6b6d8679630b8850169cd/microsoft/TypeScript/issues/30947 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a0b4081898bd80094616b3786c3135a5b065c2a311a6b6d8679630b8850169cd/microsoft/TypeScript/issues/30947 |
| og:image:alt | The non-inferrable type #30856 In resolveCallExpression, there's a big ol' comment with some context ("When a call to a generic function"). We have this thing called the anyFunctionType, which sign... |
| 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 | 27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14 |
| 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 | 624179fb8b88d26ba5bba08894eb60a1c5a1d93d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width