René's URL Explorer Experiment


Title: [documentation] Clarify the semantics of void · Issue #20006 · microsoft/TypeScript · GitHub

Open Graph Title: [documentation] Clarify the semantics of void · Issue #20006 · microsoft/TypeScript

X Title: [documentation] Clarify the semantics of void · Issue #20006 · microsoft/TypeScript

Description: In the handbook, it's stated that void is a little like the opposite of any: the absence of having any type at all. and Declaring variables of type void is not useful because you can only assign undefined or null to them The latter state...

Open Graph Description: In the handbook, it's stated that void is a little like the opposite of any: the absence of having any type at all. and Declaring variables of type void is not useful because you can only assign un...

X Description: In the handbook, it's stated that void is a little like the opposite of any: the absence of having any type at all. and Declaring variables of type void is not useful because you can only assig...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[documentation] Clarify the semantics of void","articleBody":"In [the handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html), it's stated that\r\n\r\n> void is a little like the opposite of any: the absence of having any type at all.\r\n\r\nand\r\n\r\n> Declaring variables of type void is not useful because you can only assign undefined or null to them\r\n\r\nThe latter statement is not true in any useful sense; `null` is not assignable to `void` with `--strictNullChecks` enabled, i.e. it's no more assignable to `void` than any other type, so might as well not mention it.\r\n\r\nThe former is (maybe?) approximately true, but how about saying _exactly_ what it means? I for one have never been 100% sure and would love to have some clarity. For instance, the [`unknown` type](https://github.com/Microsoft/TypeScript/issues/10715),\r\n\r\n```ts\r\ntype unknown = {} | undefined | null\r\n```\r\n\r\nis supposed to be a \"top\" type, i.e. any value should belong to it. And yet, `void` is not assignable to it.\r\n\r\n```ts\r\ndeclare const v: void\r\nconst foo: unknown = v\r\n//    ^^^ Type 'void' is not assignable to type 'unknown'.\r\n```\r\n\r\nWhy is that? According to the above, only `undefined` (and `null`, if no `--strictNullChecks`) inhabit `void`, so why is it not assignable to `unknown`?\r\n\r\nSince [there is no longer a current language specification](https://github.com/Microsoft/TypeScript/issues/14108), it seems the best available documentation is to be found at https://www.typescriptlang.org/docs/home.html, so it would be great if it could give a crisp definition of `void`!","author":{"url":"https://github.com/pelotom","@type":"Person","name":"pelotom"},"datePublished":"2017-11-14T08:14:11Z","url":"https://github.com/microsoft/TypeScript/issues/20006"}

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:f49d3ab4-5188-edb0-6ef5-98dc67684bbe
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB7EC:31E99C:FDA5E6:1534F68:6B011126
html-safe-noncec54672bbf8ff5da36be01bf52c89532b9c66ce2e7dac1286bb3fcc7c7894e424
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0VDOjMxRTk5QzpGREE1RTY6MTUzNEY2ODo2QjAxMTEyNiIsInZpc2l0b3JfaWQiOiIxNDUwNzQ1NzIyODAxNTU3Nzk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacdc096238f7a32b12028e0721e23c035a77d67e8cc7f6b4cf31d659e90b4cf6d0
hovercard-subject-tagissue:273701871
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/20006/issue_layout
twitter:imagehttps://opengraph.githubassets.com/46e8bbbeae0c7d1410e1b71b401993e9ad9a12c8209471d9ed2c2d4c231c435f/microsoft/TypeScript/issues/20006
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/46e8bbbeae0c7d1410e1b71b401993e9ad9a12c8209471d9ed2c2d4c231c435f/microsoft/TypeScript/issues/20006
og:image:altIn the handbook, it's stated that void is a little like the opposite of any: the absence of having any type at all. and Declaring variables of type void is not useful because you can only assign un...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepelotom
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
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
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/20006#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F20006
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%2F20006
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/20006
Reloadhttps://github.com/microsoft/TypeScript/issues/20006
Reloadhttps://github.com/microsoft/TypeScript/issues/20006
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests310 (310)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/20006
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/20006
[documentation] Clarify the semantics of voidhttps://github.com/microsoft/TypeScript/issues/20006#top
https://github.com/ahejlsberg
SpecIssues related to the TypeScript language specificationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Spec%22
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issue-273701871
the handbookhttps://www.typescriptlang.org/docs/handbook/basic-types.html
unknown typehttps://github.com/Microsoft/TypeScript/issues/10715
there is no longer a current language specificationhttps://github.com/Microsoft/TypeScript/issues/14108
https://www.typescriptlang.org/docs/home.htmlhttps://www.typescriptlang.org/docs/home.html
Nexthttps://github.com/microsoft/TypeScript/issues/20006?timeline_page=1
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
SpecIssues related to the TypeScript language specificationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Spec%22
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#event-1341422145
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#event-1341422244
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344343843
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344353133
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344358604
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344358699
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344398101
#10715https://github.com/microsoft/TypeScript/issues/10715
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344403218
#8581https://github.com/microsoft/TypeScript/issues/8581
#8584https://github.com/microsoft/TypeScript/issues/8584
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344405460
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344410732
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344412481
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Nov 14, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344414116
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Nov 15, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344448926
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Nov 15, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344449175
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Nov 15, 2017https://github.com/microsoft/TypeScript/issues/20006#issuecomment-344452850
https://github.com/simonbuchan
Simon Buchan (simonbuchan)https://github.com/simonbuchan
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-363992961
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-363993694
#21644https://github.com/microsoft/TypeScript/issues/21644
https://github.com/simonbuchan
Simon Buchan (simonbuchan)https://github.com/simonbuchan
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-363995246
#21368 (comment)https://github.com/microsoft/TypeScript/issues/21368#issuecomment-363270358
#10715 (comment)https://github.com/microsoft/TypeScript/issues/10715#issuecomment-363271318
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-363995394
https://github.com/simonbuchan
Simon Buchan (simonbuchan)https://github.com/simonbuchan
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-363997208
rust #[must_use]https://doc.rust-lang.org/std/result/#results-must-be-used
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-363997458
https://github.com/simonbuchan
Simon Buchan (simonbuchan)https://github.com/simonbuchan
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-363997937
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-363998223
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-364002239
https://github.com/simonbuchan
Simon Buchan (simonbuchan)https://github.com/simonbuchan
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-364004264
non-goalshttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals#non-goals
#8584https://github.com/microsoft/TypeScript/issues/8584
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-364004891
openedhttps://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue+sort%3Aupdated-desc+author%3Aaleksey-bykov
https://github.com/simonbuchan
Simon Buchan (simonbuchan)https://github.com/simonbuchan
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-364006211
elmhttp://elm-lang.org/
add a flag to disable () => void being subtype of () => a #8584https://github.com/microsoft/TypeScript/issues/8584
https://github.com/zpdDG4gta8XKpMCd
ZpdDG4gta (zpdDG4gta8XKpMCd)https://github.com/zpdDG4gta8XKpMCd
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-364010114
https://github.com/simonbuchan
Simon Buchan (simonbuchan)https://github.com/simonbuchan
on Feb 8, 2018https://github.com/microsoft/TypeScript/issues/20006#issuecomment-364017112
https://www.npmjs.com/package/tslint-immutable#no-expression-statementhttps://www.npmjs.com/package/tslint-immutable#no-expression-statement
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 20, 2020https://github.com/microsoft/TypeScript/issues/20006#event-3567492976
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/20006
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/20006
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
SpecIssues related to the TypeScript language specificationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Spec%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.