René's URL Explorer Experiment


Title: Proposal for proper top type · Issue #23838 · microsoft/TypeScript · GitHub

Open Graph Title: Proposal for proper top type · Issue #23838 · microsoft/TypeScript

X Title: Proposal for proper top type · Issue #23838 · microsoft/TypeScript

Description: Right now there are three interesting types for unknown values: never can be assigned to anything, but nothing can be assigned to it any can be assigned to anything and anything can be assigned to it unknown can't be assigned to anything...

Open Graph Description: Right now there are three interesting types for unknown values: never can be assigned to anything, but nothing can be assigned to it any can be assigned to anything and anything can be assigned to ...

X Description: Right now there are three interesting types for unknown values: never can be assigned to anything, but nothing can be assigned to it any can be assigned to anything and anything can be assigned to ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal for proper top type","articleBody":"Right now there are three interesting types for unknown values:\r\n\r\n`never` can be assigned to anything, but nothing can be assigned to it\r\n`any` can be assigned to anything and anything can be assigned to it\r\n`unknown` can't be assigned to anything, but everything can be assigned to it\r\n\r\nIn type theory terms, `never` is a bottom, `unknown` is a top and `any` is something you don't usually see, but is really handy for a language like TS.\r\n\r\nHere are the properties for `never` and `any`, aside from the abovementioned ones:\r\n\r\n(`A` ranges over all types, including `null` and `undefined`, but excluding `never`, `any`, `{}` and `unknown` itself)\r\n\r\n`A | never = A`\r\n`A & never = never`\r\n`never extends A ? true : false = true`\r\n\r\n`A | any = any`\r\n`A & any = any`\r\n`any extends A ? true : false = true | false`\r\n\r\nNow, I've been using `type unknown = {} | null | undefined` as my top, like most people. It works mostly fine for assignment, but it fails when it comes to unions, intersections and conditionals. For a proper top type, I need the following properties:\r\n\r\n`A | unknown = unknown`\r\n`A & unknown = A`\r\n`unknown extends A ? true : false = false`\r\n\r\nCan we get a type in the language called `unknown` that fits these properties? Another name that might work would be `all`, but I think that's confusing, as the properties it has would confuse people (it's not immediately clear why `A & all = A` in that case.\r\n\r\nIt's become clear to me as of late, I shouldn't use `any` in my code at all, except when I'm absolutely sure I want to turn off type checking. The problem is, a lot of the cases where I use `any`, it's because I need a top type. Especially intersections are hard to deal with, without a top type.","author":{"url":"https://github.com/SimonMeskens","@type":"Person","name":"SimonMeskens"},"datePublished":"2018-05-02T21:36:24Z","url":"https://github.com/microsoft/TypeScript/issues/23838"}

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:421b0cd7-128a-d376-8130-5cf988d25067
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE504:13002:71686:8CE6D:6B00F275
html-safe-nonceff5268e67f1d4e555000e3961885e421388d300e733d3c902bb490736d061988
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTA0OjEzMDAyOjcxNjg2OjhDRTZEOjZCMDBGMjc1IiwidmlzaXRvcl9pZCI6IjE4NzczNjg5NDMxODY4NjY4MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4531584a13cec6c90db72b6c420a2aa9bd7bb0d3e26b6aba0ad8f35e3a2f8af9
hovercard-subject-tagissue:319720914
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/23838/issue_layout
twitter:imagehttps://opengraph.githubassets.com/962a5bdff1c3ca233a2884df36ffd7092754ff06ee4b413018b0c125fa86a976/microsoft/TypeScript/issues/23838
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/962a5bdff1c3ca233a2884df36ffd7092754ff06ee4b413018b0c125fa86a976/microsoft/TypeScript/issues/23838
og:image:altRight now there are three interesting types for unknown values: never can be assigned to anything, but nothing can be assigned to it any can be assigned to anything and anything can be assigned to ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSimonMeskens
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/23838#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F23838
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%2F23838
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/23838
Reloadhttps://github.com/microsoft/TypeScript/issues/23838
Reloadhttps://github.com/microsoft/TypeScript/issues/23838
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/23838
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/23838
Proposal for proper top typehttps://github.com/microsoft/TypeScript/issues/23838#top
DuplicateAn existing issue was already createdhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Duplicate%22
https://github.com/SimonMeskens
Simon Meskens (SimonMeskens)https://github.com/SimonMeskens
on May 2, 2018https://github.com/microsoft/TypeScript/issues/23838#issue-319720914
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on May 2, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386131742
#10715https://github.com/microsoft/TypeScript/issues/10715
https://github.com/SimonMeskens
Simon Meskens (SimonMeskens)https://github.com/SimonMeskens
on May 2, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386133974
https://github.com/SimonMeskens
Simon Meskens (SimonMeskens)https://github.com/SimonMeskens
on May 2, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386136187
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on May 2, 2018https://github.com/microsoft/TypeScript/issues/23838#event-1606575060
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
on May 2, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386153768
https://github.com/SimonMeskens
Simon Meskens (SimonMeskens)https://github.com/SimonMeskens
on May 2, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386156807
Jack Williams (@jack-williams)https://github.com/jack-williams
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
on May 3, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386160024
herehttps://github.com/Microsoft/TypeScript/issues/10715#issuecomment-363271318
https://github.com/SimonMeskens
Simon Meskens (SimonMeskens)https://github.com/SimonMeskens
on May 3, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386163552
https://github.com/SimonMeskens
Simon Meskens (SimonMeskens)https://github.com/SimonMeskens
on May 3, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386164094
https://github.com/SimonMeskens
Simon Meskens (SimonMeskens)https://github.com/SimonMeskens
on May 3, 2018https://github.com/microsoft/TypeScript/issues/23838#issuecomment-386167183
Simon Meskens (SimonMeskens)https://github.com/SimonMeskens
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 3, 2018https://github.com/microsoft/TypeScript/issues/23838#event-1606767135
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
DuplicateAn existing issue was already createdhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Duplicate%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on May 3, 2018https://github.com/microsoft/TypeScript/issues/23838#event-1606911644
microsofthttps://github.com/microsoft
on Jul 31, 2018https://github.com/microsoft/TypeScript/issues/23838#event-1763325085
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/23838
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/23838
DuplicateAn existing issue was already createdhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Duplicate%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.