Title: Design Meeting Notes, 4/26/2023 · Issue #54038 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 4/26/2023 · Issue #54038 · microsoft/TypeScript
X Title: Design Meeting Notes, 4/26/2023 · Issue #54038 · microsoft/TypeScript
Description: #54000 Inference priority problem between never in empty array and T Difference between inference in two instantiations of same alias and structural algorithm Fixes are likely to be over-targeted corner cases, trading one problem for ano...
Open Graph Description: #54000 Inference priority problem between never in empty array and T Difference between inference in two instantiations of same alias and structural algorithm Fixes are likely to be over-targeted c...
X Description: #54000 Inference priority problem between never in empty array and T Difference between inference in two instantiations of same alias and structural algorithm Fixes are likely to be over-targeted c...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/54038
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 4/26/2023","articleBody":"https://github.com/microsoft/TypeScript/issues/54000\r\n\r\n- Inference priority problem between `never` in empty array and `T`\r\n- Difference between inference in two instantiations of same alias and structural algorithm\r\n- Fixes are likely to be over-targeted corner cases, trading one problem for another\r\n- Conclusion: do nothing\r\n\r\nhttps://github.com/microsoft/TypeScript/pull/53995\r\n\r\n- PR doesn't affect indirect recursive tail calls, only direct self-calls\r\n- Looks good\r\n- A function that only tail calls itself and never returns anything else will be `never`, used to be an error\r\n- May need to fix an implementation detail, ensuring the call expression expression is identifier\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/53999\r\n\r\n- Would we rather revisit the whole set of rules around specifying type parameters on function calls? With this proposal, it seems like we'd always suggest people write `preferinfer`. Can we just do something like that behavior by default?\r\n - We could try just using inference instead of defaults on type parameters with defaults, only using the default if no candidates were collected\r\n- This proposal has a limitation of only omitting trailing arguments, whereas the `_` placeholder PR lets any parameter be omitted\r\n- A modifier on the type parameter doesn't make sense\r\n- There's something fishy about having a situation where type arguments need to be manually specified anyway\r\n - There are a lot of poorly designed APIs like this in the wild already\r\n - Specifying a type argument can be useful in the same kinds of cases where it's useful to explicitly annotate a variable declaration, like setting the element type of an empty array (`new Set\u003cstring>()` comes to mind)\r\n - People also use additional type parameters with defaults as scoped type aliases\r\n- Worth looking at `_` proposal again, or even just always allowing partial tye argument specification (in expression positions)\r\n - Type argument arity is first pass of overload selection 😬\r\n- Conclusion: update the `_` PR, run RWC, see what happens\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/54005\r\n\r\n- Maybe Jake broke it\r\n- Oops we're not actually prepared to talk about this one\r\n- At least typescript-bot successfully bisected it\r\n- In an ideal world we'd be able to try both and see which one works\r\n- Conclusion: Anders would like to look at it\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/53970\r\n\r\n- Someone is relying on an implementation detail of when we resolve indexed access type to make a higher-order polymorphism mechanism\r\n- We now defer reduceable intersection types when they occur in indexed access types\r\n- The deferral is kind of the right thing to do, but it breaks the example\r\n- `(F & { readonly A: A })['type']` used to reduce to `F['type']` without acknowledging that the intersection could produce `never`\r\n- We could potentially fix this by doing the intersection reduction `(A & B)[C]` to `A[C] & B[C]` during inference and inferring from both\r\n\r\nhttps://github.com/microsoft/TypeScript/issues/54011\r\n\r\n- Needed for a version of Monaco that doesn't bundle TS so you can dynamically figure out what libs are available\r\n- Might be more future-proof to expose it as a function instead\r\n- Can you not just read all the file names in `typescript/lib`?\r\n - No, because you might be getting TS files from a CDN, and there's not necessarily a consistent way to get a listing","author":{"url":"https://github.com/andrewbranch","@type":"Person","name":"andrewbranch"},"datePublished":"2023-04-26T21:51:46Z","url":"https://github.com/microsoft/TypeScript/issues/54038"}
| 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:6fd95256-234d-575c-3a42-1f7ee7043ea3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 957C:1D86C4:21EBD38:2B0C71E:6B01784F |
| html-safe-nonce | a61e6f4389661a82b1127950dd8578d5ec0a933bc1a9134029757d6f47f988f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTdDOjFEODZDNDoyMUVCRDM4OjJCMEM3MUU6NkIwMTc4NEYiLCJ2aXNpdG9yX2lkIjoiNTE1MTA4MzE2MzI2NjY3NjgxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ac726f305eba6cfdb9fcd141e59b0dca674dd9f4556528e2efc0543fc9eb6273 |
| hovercard-subject-tag | issue:1685786227 |
| 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/54038/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ab98ad41284c8c17bf7b4af5e7455c65a0ba480bb337207d770a20b148518f28/microsoft/TypeScript/issues/54038 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ab98ad41284c8c17bf7b4af5e7455c65a0ba480bb337207d770a20b148518f28/microsoft/TypeScript/issues/54038 |
| og:image:alt | #54000 Inference priority problem between never in empty array and T Difference between inference in two instantiations of same alias and structural algorithm Fixes are likely to be over-targeted c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andrewbranch |
| 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