René's URL Explorer Experiment


Title: Allow functions to have `new symbol` as the return type · Issue #37469 · microsoft/TypeScript · GitHub

Open Graph Title: Allow functions to have `new symbol` as the return type · Issue #37469 · microsoft/TypeScript

X Title: Allow functions to have `new symbol` as the return type · Issue #37469 · microsoft/TypeScript

Description: Search Terms unique symbol new unique symbol new symbol Suggestion I request that unique symbol be allowed as the return type of a function declaration. Alternatively, it might be better to use new symbol to disambiguate #40106 (comment)...

Open Graph Description: Search Terms unique symbol new unique symbol new symbol Suggestion I request that unique symbol be allowed as the return type of a function declaration. Alternatively, it might be better to use new...

X Description: Search Terms unique symbol new unique symbol new symbol Suggestion I request that unique symbol be allowed as the return type of a function declaration. Alternatively, it might be better to use new...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow functions to have `new symbol` as the return type","articleBody":"## Search Terms\r\n\r\n- unique symbol\r\n- new unique symbol\r\n- new symbol\r\n\r\n## Suggestion\r\n\r\nI request that `unique symbol` be allowed as the return type of a function declaration.\r\n\r\nAlternatively, it might be better to use `new symbol` to disambiguate \u003chttps://github.com/microsoft/TypeScript/issues/40106#issuecomment-677741032>.\r\n\r\n## Use Cases\r\n\r\nCurrently, it’s impossible to create an alias or a wrapper function for the global `Symbol` constructor and use that to construct unique symbols:\r\n\r\n```js\r\n// ./es-globals/fundamentals.js\r\nexport const ESSymbol = Symbol;\r\nexport const { for: ESSymbol_for } = ESSymbol;\r\n```\r\n```ts\r\n// ./es-globals/fundamentals.d.ts\r\nexport import ESSymbol = globalThis.Symbol;\r\nexport declare const ESSymbol_for: typeof ESSymbol.for;\r\n```\r\n\r\n```js\r\n// ./symbols.js\r\nimport { ESSymbol, ESSymbol_for } from \"./es-globals/fundamentals.js\";\r\n\r\n// should be `unique symbol`, but is instead `symbol`:\r\nexport const customSymbol = ESSymbol(\"custom\");\r\n\r\n// should be `unique symbol` or `global symbol \"nodejs.util.inspect.custom\"`,\r\n// but is instead `symbol`:\r\nexport const nodejs_util_inspect_custom = ESSymbol_for(\"nodejs.util.inspect.custom\");\r\n\r\n// should be `unique symbol` or `global symbol \"nodejs.util.promisify.custom\"`,\r\n// but is instead `symbol`:\r\nexport const nodejs_util_promisify_custom = ESSymbol_for(\"nodejs.util.promisify.custom\");\r\n```\r\n\r\n## Examples\r\n\r\nThis would allow defining `SymbolConstructor` as:\r\n\r\n```ts\r\ndeclare interface SymbolConstructor {\r\n\t/**\r\n\t * Returns a new unique Symbol value.\r\n\t * @param description Description of the new symbol value.\r\n\t */\r\n\t(description?: string | number): new symbol;\r\n\r\n\t/**\r\n\t * Returns a Symbol object from the global symbol registry matching the given key if found.\r\n\t * Otherwise, returns a new symbol with this key.\r\n\t * @param key key to search for.\r\n\t */\r\n\tfor\u003cT extends string>(key: T): global symbol T;\r\n\t// or, until GH-35909 is implemented:\r\n\tfor(key: string): new symbol;\r\n}\r\n```\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n\r\n* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [x] This could be implemented without emitting different JS based on the types of the expressions\r\n* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)\r\n* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n## See also\r\n\r\n- \u003chttps://github.com/microsoft/TypeScript/issues/36468>\r\n- \u003chttps://github.com/microsoft/TypeScript/issues/35909> (`global symbol \"\u003cname>\"` proposal)\r\n- \u003chttps://github.com/microsoft/TypeScript/pull/24738>\r\n- \u003chttps://github.com/microsoft/TypeScript/issues/24506>\r\n- \u003chttps://github.com/microsoft/TypeScript/issues/40106>\r\n- \u003chttps://github.com/microsoft/TypeScript/pull/42543>\r\n- \u003chttps://github.com/microsoft/TypeScript/issues/53282>","author":{"url":"https://github.com/ExE-Boss","@type":"Person","name":"ExE-Boss"},"datePublished":"2020-03-19T00:26:46Z","url":"https://github.com/microsoft/TypeScript/issues/37469"}

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:630cf786-94cc-4858-e437-a26b6cda96d1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB326:99B56:236C63:3200DB:6B0468F5
html-safe-noncebd7df6c7eabe457e3762fd63b4ef74947f0a1826e63551b2d3997ad77d28d4cb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzI2Ojk5QjU2OjIzNkM2MzozMjAwREI6NkIwNDY4RjUiLCJ2aXNpdG9yX2lkIjoiNTM2MTg2MzU0MDkyNjA4MTI2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfbc2bad204f30e099817cd071adc358f922fa93a23400613754a0a04247ded28
hovercard-subject-tagissue:584082162
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/37469/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2073c1ea2291355d0550a9f838f5c47b015df96314a5fdd4418954850ab891bd/microsoft/TypeScript/issues/37469
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2073c1ea2291355d0550a9f838f5c47b015df96314a5fdd4418954850ab891bd/microsoft/TypeScript/issues/37469
og:image:altSearch Terms unique symbol new unique symbol new symbol Suggestion I request that unique symbol be allowed as the return type of a function declaration. Alternatively, it might be better to use new...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameExE-Boss
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
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
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/37469#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F37469
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%2F37469
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/37469
Reloadhttps://github.com/microsoft/TypeScript/issues/37469
Reloadhttps://github.com/microsoft/TypeScript/issues/37469
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests319 (319)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/37469
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/37469
Allow functions to have new symbol as the return typehttps://github.com/microsoft/TypeScript/issues/37469#top
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/ExE-Boss
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Mar 19, 2020https://github.com/microsoft/TypeScript/issues/37469#issue-584082162
#40106 (comment)https://github.com/microsoft/TypeScript/issues/40106#issuecomment-677741032
TypeScript's Design Goalshttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
Can't use aliases of the global Symbol value to refer to its properties in the same manner or create unique symbols #36468https://github.com/microsoft/TypeScript/issues/36468
Can't evaluate equality of symbols made by Symbol.for #35909https://github.com/microsoft/TypeScript/issues/35909
Expunge the concept of well-known symbols from the checker #24738https://github.com/microsoft/TypeScript/pull/24738
"Unique symbol" returned from the function becomes "symbol" #24506https://github.com/microsoft/TypeScript/issues/24506
Cannot create a unique symbol at each function call #40106https://github.com/microsoft/TypeScript/issues/40106
Eliminate well known symbols as a concept in the checker and rely on unique symbols #42543https://github.com/microsoft/TypeScript/pull/42543
Symbols produced by an alias of the Symbol constructor cannot be used as object keys in types/interfaces/classes, etc. #53282https://github.com/microsoft/TypeScript/issues/53282
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Mar 19, 2020https://github.com/microsoft/TypeScript/issues/37469#event-3146027799
https://github.com/Shou
Benedict Aas (Shou)https://github.com/Shou
on May 11, 2020https://github.com/microsoft/TypeScript/issues/37469#issuecomment-626891945
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Jan 25, 2021https://github.com/microsoft/TypeScript/issues/37469#event-4244465784
https://github.com/DerekZiemba
Derek Ziemba (DerekZiemba)https://github.com/DerekZiemba
on Mar 3, 2021https://github.com/microsoft/TypeScript/issues/37469#issuecomment-790060343
Benedict Aas (@Shou)https://github.com/Shou
https://user-images.githubusercontent.com/7283693/109873321-34721480-7c33-11eb-84f0-681e62481651.png
https://github.com/parzhitsky
Dmytro Parzhytskyi (parzhitsky)https://github.com/parzhitsky
on Jun 13, 2022https://github.com/microsoft/TypeScript/issues/37469#issuecomment-1153681373
Try ithttps://tsplay.dev/wOGGrw
Try ithttps://tsplay.dev/mLqqAW
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jun 13, 2022https://github.com/microsoft/TypeScript/issues/37469#issuecomment-1154140340
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Mar 16, 2023https://github.com/microsoft/TypeScript/issues/37469#event-8763268756
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Mar 16, 2023https://github.com/microsoft/TypeScript/issues/37469#event-8763271873
https://github.com/eligrey
Eli Grey (eligrey)https://github.com/eligrey
on Jun 12, 2023https://github.com/microsoft/TypeScript/issues/37469#issuecomment-1587998890
SuperLlama88888https://github.com/SuperLlama88888
on Aug 1, 2025https://github.com/microsoft/TypeScript/issues/37469#event-18932112254
Improve types, fix bugshttps://github.com/SuperLlama88888/holoprint/commit/c7b139ab24aa91e28affb7620b0bae993c1993c1
c7b139ahttps://github.com/SuperLlama88888/holoprint/commit/c7b139ab24aa91e28affb7620b0bae993c1993c1
Turadg Aleahmad (turadg)https://github.com/turadg
on Apr 15, 2026https://github.com/microsoft/TypeScript/issues/37469#event-24548275906
fix(pass-style): unblock downstream decl-emit; obviate agoric-sdk pat…https://github.com/endojs/endo/commit/8ff17f55a5459f8b05c501b654b58d6a1c2e089d
8ff17f5https://github.com/endojs/endo/commit/8ff17f55a5459f8b05c501b654b58d6a1c2e089d
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/37469
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/37469
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.