René's URL Explorer Experiment


Title: Design Meeting Notes, 12/14/2018 · Issue #29033 · microsoft/TypeScript · GitHub

Open Graph Title: Design Meeting Notes, 12/14/2018 · Issue #29033 · microsoft/TypeScript

X Title: Design Meeting Notes, 12/14/2018 · Issue #29033 · microsoft/TypeScript

Description: Control Flow Analysis for Destructuring Assignments #28792 let { x } = obj; // *should* be equivalent to let x = obj.x; And this holds for any level of nesting. let { x: { y } } = obj; // *should* be equivalent to let y = obj.x.y; And th...

Open Graph Description: Control Flow Analysis for Destructuring Assignments #28792 let { x } = obj; // *should* be equivalent to let x = obj.x; And this holds for any level of nesting. let { x: { y } } = obj; // *should* ...

X Description: Control Flow Analysis for Destructuring Assignments #28792 let { x } = obj; // *should* be equivalent to let x = obj.x; And this holds for any level of nesting. let { x: { y } } = obj; // *should* ...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/29033

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 12/14/2018","articleBody":"# Control Flow Analysis for Destructuring Assignments\r\n\r\n#28792\r\n\r\n```ts\r\nlet { x } = obj;\r\n\r\n// *should* be equivalent to\r\n\r\nlet x = obj.x;\r\n```\r\n\r\nAnd this holds for any level of nesting.\r\n\r\n```ts\r\nlet { x: { y } } = obj;\r\n\r\n// *should* be equivalent to\r\n\r\nlet y = obj.x.y;\r\n```\r\n\r\nAnd the same for object pattern assignments\r\n\r\n```ts\r\n({ x } = obj);\r\n\r\n// *should* be equivalent to\r\n\r\nx = obj.x;\r\n```\r\n\r\n* Today, we don't track these assignments as part of control flow analysis.\r\n    * Trying to do so is actually pretty complex.\r\n    * As a solution, we're considering a new \"synthetic property access\"\r\n\r\n# Unification\r\n\r\n* Consider\r\n\r\n  ```ts\r\n  function compose\u003cA, B, C>(f1: (x: A) => B, f2: (x: B) => C): (x: A) => C { /*...*/ }\r\n  function arrayToList\u003cT>(x: T[]): List\u003cT> { /*...*/ }\r\n  function box\u003cU>(x: U): { value: U } { /*...*/ }\r\n  function first\u003cW>(xs: List\u003cW>): W { /*...*/ }\r\n  ```\r\n\r\n* What if you wanted to write a function that `box`'d a list converted from an array? Ideally you could write the following:\r\n\r\n  ```ts\r\n  compose(arrayToList, box)\r\n  ```\r\n\r\n  and you'd get the type `\u003cT>(xs: T[]) => { value: List\u003cT> }`\r\n\r\n    * Today the problem is that when our inference process sees no inferences for a type parameter, it infers its upper bound (which is implicitly `{}`).\r\n    * Instead, what you really want to do is see that there are *free type variables* that are captured in the output, and attach them to the output type.\r\n    * Starting off with this idea comes close. You get `\u003cT, U>(xs: T) => U`, but of course, this doesn't propagate the original structures of inferences. Furthermore, `T` and `U` are unrelated. So what you want to do is unify the type variables during the first inference pass.\r\n* *When* you could do this is tough; you can't just replace the current inference process with unification. No telling what could break. But we can revisit that.\r\n* So saying \"unification would do this\" is fine, but how that happens is glossed over. There's some difficult cases.\r\n* ```\r\n  A : T[]\r\n  B : List\u003cT>, SomeOtherList\u003cW>\r\n  C : W\r\n  ```\r\n* Could say we only unify on named types.\r\n    * What about object literal types?\r\n    * It's a structural type system; y'can't backpedal on that.\r\n*  Today we fix type parameters once they're requested in an anonymous function. How does this work with contextual typing?\r\n    * Say it's there for single-signature types?\r\n        * It's not about overloads.\r\n    * Would we need to add type variables for anonymous functions?\r\n        * #17428\r\n    * Also, building up constraints could get gross:\r\n\r\n      ```ts\r\n      compose(arrayToList, x => x.get(0));\r\n      ```\r\n    * Could defer things.\r\n    * The type might look gross for users. `{ get(): T }` is not so bad, but imagine a more complex function body.\r\n* When you you're editing, what happens when the anonymous function comes first?\r\n    * Hah.\r\n    * Same downsides as today.\r\n    *  Functional users won't be happy with that experience.\r\n        * \"Daniel's not wrong\"\r\n            * \\[\\[First time anyone's ever said that]]\r\n* Seems like there's a lot of open questions.\r\n\r\n# Call signatures on union types\r\n\r\n#7294\r\n#29011\r\n\r\n* We erred on the safe side much of the time to say that signatures had to be identical.\r\n* In the last release, we expanded this to have signatures that totally subsumed other signatures available to callers.\r\n* When we unified JSX logic with call resolution logic, React users got broken because we were more permissive in React.\r\n* Okay, so we methods available a lot of the time when you have two union types; however, it doesn't work great for methods that take callbacks.\r\n    * For example, if you have `xs: string[] | number[]`, trying to call `xs.forEach` is possible, but lambda functions don't undergo contextual typing (one of our inference processes).\r\n    * The reason why is that the contextual type is something like `((x: string) => void) & ((y: number) => void)`.\r\n    * You'd think that would be fine and in `xs.forEach(a => a)`, `a` would have the type `string | number`, but what instead happens is that `((x: string) => void) & ((y: number) => void)` forms something that looks like an overload list, and lambdas aren't contextually typed by overloads.\r\n* Three solutions:\r\n    * Change contextual typing to be contextually typed by overload lists.\r\n    * Could come up with an underlying \"intersection signature\" (we have something similar for unions).\r\n        * Means there's a difference between contextual typing and relationship checking.\r\n    * Take the current fix (#29011) as-is.\r\n        * The `forEach` case is still broken, but at least we're better.\r\n* With the intersection signature strategy, what about an intersection where one type has no call signatures, and the other has many?\r\n    * You'd have no \"intersection signature\", but a bunch of overloads.\r\n    * One thing we didn't do here is try to come up with an intersection signature for multiple overloads; seems like a combinatorial explosion.\r\n* With the overload strategy, what about UX? What about huge overload lists like in the DOM?\r\n* Should we try to remove impossible `never` parameters from these \"synthesized\" signatures?\r\n    * Seems like the wrong thing to focus on.\r\n* Out of time - seems like we're leaning towards overloads.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2018-12-14T22:36:33Z","url":"https://github.com/microsoft/TypeScript/issues/29033"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1d44ee44-d8e7-ba56-263c-158331fc2b8a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBBB0:29FFA9:5F4E3F:7A8F9F:6B00DD82
html-safe-noncef51ee714002aa8fdcbdaaf3719cc4fad11de60711c211772c3a5e1c2c6044451
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkIwOjI5RkZBOTo1RjRFM0Y6N0E4RjlGOjZCMDBERDgyIiwidmlzaXRvcl9pZCI6IjU1MzgxMDkyODkxNDg3Njc2MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac583e147f854989218f5e89779e2bf67b6d7c3a574218f65e5e1d5e157c077d63
hovercard-subject-tagissue:391302423
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/29033/issue_layout
twitter:imagehttps://opengraph.githubassets.com/93341fa9c648fac93fbdc8b3f57e5fcb97758f43951c02d70d3daeebf3c7568f/microsoft/TypeScript/issues/29033
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/93341fa9c648fac93fbdc8b3f57e5fcb97758f43951c02d70d3daeebf3c7568f/microsoft/TypeScript/issues/29033
og:image:altControl Flow Analysis for Destructuring Assignments #28792 let { x } = obj; // *should* be equivalent to let x = obj.x; And this holds for any level of nesting. let { x: { y } } = obj; // *should* ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/29033#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F29033
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F29033
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/29033
Reloadhttps://github.com/microsoft/TypeScript/issues/29033
Reloadhttps://github.com/microsoft/TypeScript/issues/29033
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/29033
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/29033
Design Meeting Notes, 12/14/2018https://github.com/microsoft/TypeScript/issues/29033#top
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 14, 2018https://github.com/microsoft/TypeScript/issues/29033#issue-391302423
#28792https://github.com/microsoft/TypeScript/issues/28792
Eliminate non-generic functions #17428https://github.com/microsoft/TypeScript/issues/17428
#7294https://github.com/microsoft/TypeScript/issues/7294
#29011https://github.com/microsoft/TypeScript/pull/29011
Allow calls on unions of dissimilar signatures #29011https://github.com/microsoft/TypeScript/pull/29011
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
on Dec 14, 2018https://github.com/microsoft/TypeScript/issues/29033#event-2028063568
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 14, 2018https://github.com/microsoft/TypeScript/issues/29033#event-2028136381
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/29033
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/29033
Design NotesNotes from our design meetingshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Design%20Notes%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.