René's URL Explorer Experiment


Title: Design Meeting Notes, 8/24/2018 · Issue #26952 · microsoft/TypeScript · GitHub

Open Graph Title: Design Meeting Notes, 8/24/2018 · Issue #26952 · microsoft/TypeScript

X Title: Design Meeting Notes, 8/24/2018 · Issue #26952 · microsoft/TypeScript

Description: Call-site inference for implicit anys This is a demo presentation [[Opens up minimatch]] "This is the codebase you open up to make yourself feel good about JavaScript" Looking at the charSet declaration function We have noImplicitAny on ...

Open Graph Description: Call-site inference for implicit anys This is a demo presentation [[Opens up minimatch]] "This is the codebase you open up to make yourself feel good about JavaScript" Looking at the charSet declar...

X Description: Call-site inference for implicit anys This is a demo presentation [[Opens up minimatch]] "This is the codebase you open up to make yourself feel good about JavaScript" Looking at the char...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 8/24/2018","articleBody":"# Call-site inference for implicit `any`s\r\n\r\nThis is a demo presentation\r\n\r\n* \\[\\[Opens up minimatch]]\r\n* \"This is the codebase you open up to make yourself feel good about JavaScript\"\r\n* Looking at the `charSet` declaration function\r\n    * We have `noImplicitAny` on\r\n    * See that it was at some point called with a `string`, and so we change the parameter type.\r\n    * If we observe a circularity, we fall back to `any` and report an error.\r\n* Is this TypeScript too?\r\n    * It works for either JavaScript or TypeScript\r\n* How bad is it?\r\n    * The graphs are confusing, but it's over 4.5x slower to look at how the function itself is called to figure out the parameter types.\r\n    * If you only look at use-sites of parameters within the bodies of functions, it'x ~1.8x slower.\r\n* We mostly imagine that this would be a one-time shot tool\r\n* Could also imagine that we'd improve the performance here, but it's decent\r\n* Did we look at the tests at all? You'd figure unit tests would be great for figuring out use-site.\r\n    * But that's a problem for stupid tests like \"assert that this throws when I pass in a number\"\r\n* But you get 40% more type coverage on Webpack.\r\n    * That's like half the way there.\r\n    * But even that's not worth slowing down the type-checker so dramatically.\r\n    * Seems like we should be leveraging this *somehow*.\r\n\r\n# Weird behavior for spreading arrayish types\r\n\r\n#26110\r\n\r\n* We now allow rest parameters to have a generic type (`T`).\r\n    * The requirement has been that that generic type needs to extend an array (e.g. `T extends any[]`).\r\n* But you can come up with several things that actually satisfy arrays.\r\n    * Object subtypes:\r\n\r\n      ```ts\r\n      interface CoolArray extends Array\u003cstring>\r\n      function foo\u003cT extends any[]>(...args: T): T {\r\n          throw 0;\r\n      }\r\n      foo\u003cCoolArray>();\r\n      ```\r\n* Problem: what does it mean to spread in these object subtypes?\r\n    * For these object subtypes, any argument list translated to an array or a tuple won't ever satisfy these types.\r\n* Solution: if you ever have a type parameter constrained to something other than an `Array` or `ReadonlyArray`, and you are trying to relate to a generic rest parameter, you infer a tuple type from the matching argument and try to infer from that.\r\n    * If that inference fails, TypeScript falls back to the constraint and relates against that.\r\n\r\n* Union subtypes:\r\n\r\n  ```ts\r\n  function foo\u003cT extends [] | [number, number]>  (...args: T): T {\r\n      throw 0;\r\n  }\r\n  foo\u003cCoolArray>();\r\n  ```\r\n\r\n# Named type arguments, associated types, and partial inference\r\n\r\n* In #23696, we realized that making every type parameter nameable would be problematic for existing APIs - it exposes what were thought of as mostly implementation details.\r\n* What problems were we trying to solve?\r\n    1. Positional type arguments are problematic because it locks you down.\r\n    2. Using a type parameter as a default for a temporary/local type.\r\n        * `StrictEventEmitter`\r\n        * \"Is this a real type!?\"\r\n    3. Specialized subclasses:\r\n\r\n      ```ts\r\n      class Box\u003cT> { x: T }\r\n      class SpecialBox extends Box\u003cSpeical>\r\n\r\n      // How do I specialize this further without making SpecialBox generic?\r\n      class SpecialSpecialBox extends SpecialBox {\r\n      }\r\n      ```\r\n* At a high level, we want to be able to place types within types.\r\n\r\n  ```ts\r\n  declare class BoxObserver\u003cT> {\r\n      type Boxified = { value: T };\r\n      get(): Boxified;\r\n  }\r\n  let x: BoxObserver\u003cnumber, \r\n  ```\r\n    * Hold up though, that means in this class you can't write the following, since you don't know if `Boxified` will be further specialized.\r\n\r\n      ```ts\r\n      let x: T = this.get().value\r\n      ```\r\n* Feels strange that these can appear in the type parameter list.\r\n* One of the core differences is that we also don't do inference on these types.\r\n* Also, these must be associated with the instance.\r\n    * They must be, because they close over the instance type parameters.\r\n* If changing the type in the subtype changes the behavior in the supertype, then it must be a type variable.\r\n* But there are merits to just having this as an alias.\r\n    * Could imagine\r\n\r\n      ```ts\r\n      declare class Foo\u003cT> with Boxified = { value: T } {\r\n          get(): Boxified;\r\n      }\r\n      ```\r\n* Also, feels strange that there is some mixing of type parameters and aliases:\r\n\r\n  ```ts\r\n  type Foo\u003cT> =\r\n      type X = Foo\u003cT>[] in {\r\n          // ...\r\n      };\r\n  ```","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2018-09-06T22:52:18Z","url":"https://github.com/microsoft/TypeScript/issues/26952"}

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:aa1abf86-165c-ffb4-ae43-a64bee164720
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE320:215B92:2DAB983:3CD73E2:6B01D538
html-safe-nonce4984e55efefd04b780599b9f31ee892bd27b10304c0e312b85840b4b94832b37
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzIwOjIxNUI5MjoyREFCOTgzOjNDRDczRTI6NkIwMUQ1MzgiLCJ2aXNpdG9yX2lkIjoiODcyNDY0MTM0Njc3MTYwNDc5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac13e291bd283d82f57bdc4121917e8086e36e7f9408e1b0fbfbe8cdb928c89a65
hovercard-subject-tagissue:357857032
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/26952/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b4b42c4d55a73f7641c76eebe87ff26b684daedec6904f4d263f9a3906c7287f/microsoft/TypeScript/issues/26952
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b4b42c4d55a73f7641c76eebe87ff26b684daedec6904f4d263f9a3906c7287f/microsoft/TypeScript/issues/26952
og:image:altCall-site inference for implicit anys This is a demo presentation [[Opens up minimatch]] "This is the codebase you open up to make yourself feel good about JavaScript" Looking at the charSet declar...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/26952#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F26952
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%2F26952
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/26952
Reloadhttps://github.com/microsoft/TypeScript/issues/26952
Reloadhttps://github.com/microsoft/TypeScript/issues/26952
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)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/26952
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/26952
Design Meeting Notes, 8/24/2018https://github.com/microsoft/TypeScript/issues/26952#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 Sep 6, 2018https://github.com/microsoft/TypeScript/issues/26952#issue-357857032
#26110https://github.com/microsoft/TypeScript/issues/26110
Named Type Arguments & Partial Type Argument Inference #23696https://github.com/microsoft/TypeScript/pull/23696
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 Sep 6, 2018https://github.com/microsoft/TypeScript/issues/26952#event-1831633953
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 7, 2018https://github.com/microsoft/TypeScript/issues/26952#event-2013443363
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/26952
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/26952
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.