René's URL Explorer Experiment


Title: Make Symbol.* (e.g. Symbol.iterator) unique symbols · Issue #27525 · microsoft/TypeScript · GitHub

Open Graph Title: Make Symbol.* (e.g. Symbol.iterator) unique symbols · Issue #27525 · microsoft/TypeScript

X Title: Make Symbol.* (e.g. Symbol.iterator) unique symbols · Issue #27525 · microsoft/TypeScript

Description: Search Terms Suggestion Use this: declare function Symbol (x?: string | number): symbol declare namespace Symbol { const prototype: symbol const iterator: unique symbol } Or this: interface SymbolConstructor { (x?: string | number): symb...

Open Graph Description: Search Terms Suggestion Use this: declare function Symbol (x?: string | number): symbol declare namespace Symbol { const prototype: symbol const iterator: unique symbol } Or this: interface SymbolC...

X Description: Search Terms Suggestion Use this: declare function Symbol (x?: string | number): symbol declare namespace Symbol { const prototype: symbol const iterator: unique symbol } Or this: interface SymbolC...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make Symbol.* (e.g. Symbol.iterator) unique symbols","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the \"Common Feature Requests\" section.\r\n\r\n-->\r\n\r\n## Search Terms\r\n\r\n\u003c!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->\r\n\r\n## Suggestion\r\n\r\nUse this:\r\n\r\n```typescript\r\ndeclare function Symbol (x?: string | number): symbol\r\n\r\ndeclare namespace Symbol {\r\n  const prototype: symbol\r\n  const iterator: unique symbol\r\n}\r\n```\r\n\r\nOr this:\r\n\r\n```typescript\r\ninterface SymbolConstructor {\r\n  (x?: string | number): symbol\r\n  readonly prototype: symbol\r\n  readonly iterator: unique symbol\r\n}\r\n\r\ndeclare var Symbol: SymbolConstructor\r\n```\r\n\r\nInstead of this:\r\n\r\n```typescript\r\ninterface SymbolConstructor {\r\n  (x?: string | number): symbol\r\n  readonly prototype: symbol\r\n  readonly iterator: symbol\r\n}\r\n\r\ndeclare var Symbol: SymbolConstructor\r\n```\r\n\r\n## Use Cases\r\n\r\nRight now, I can do this for custom `unique symbol`:\r\n\r\n```typescript\r\nconst foo = Symbol() // unique symbol\r\nconst bar: typeof foo = foo\r\n\r\nconst baz: {\r\n\t[foo]: number\r\n} = {\r\n\t[bar]: 123\r\n}\r\n```\r\n\r\nBut not for `Symbol.*`\r\n\r\n```typescript\r\n// Expecting 'typeof Symbol.iterator' but received 'symbol'\r\nconst iterator: typeof Symbol.iterator = Symbol.iterator\r\n\r\n// This is not working\r\nconst iterable: Iterable\u003cnumber> = {\r\n  * [iterator] () {\r\n    yield * [0, 1, 2, 3]\r\n  }\r\n}\r\n```\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\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. new expression-level syntax)\r\n\r\n---\r\n\r\n[Playground Link](https://www.typescriptlang.org/play/#src=declare%20function%20FakeSymbol%20()%3A%20symbol%0D%0A%0D%0Adeclare%20namespace%20FakeSymbol%20%7B%0D%0A%20%20const%20prototype%3A%20symbol%0D%0A%20%20const%20iterator%3A%20unique%20symbol%0D%0A%7D%0D%0A%0D%0Aconst%20iterator%3A%20typeof%20FakeSymbol.iterator%20%3D%20FakeSymbol.iterator%0D%0A%0D%0Aconst%20foo%3A%20%7B%0D%0A%20%20%5BFakeSymbol.iterator%5D%3A%20number%0D%0A%7D%20%3D%20%7B%0D%0A%20%20%5Biterator%5D%3A%20123%0D%0A%7D%0D%0A) ([This](https://www.typescriptlang.org/play/#src=interface%20FakeSymbolConstructor%20%7B%0D%0A%20%20(x%3F%3A%20number%20%7C%20string)%3A%20symbol%0D%0A%20%20readonly%20prototype%3A%20symbol%0D%0A%20%20readonly%20iterator%3A%20unique%20symbol%0D%0A%7D%0D%0A%0D%0Adeclare%20const%20FakeSymbol%3A%20FakeSymbolConstructor%0D%0A%0D%0Aconst%20iterator%3A%20typeof%20FakeSymbol.iterator%20%3D%20FakeSymbol.iterator%0D%0A%0D%0Aconst%20foo%3A%20%7B%0D%0A%20%20%5BFakeSymbol.iterator%5D%3A%20number%0D%0A%7D%20%3D%20%7B%0D%0A%20%20%5Biterator%5D%3A%20123%0D%0A%7D%0D%0A) also works)\r\n\r\n[Related Issue](https://github.com/Microsoft/TypeScript/issues/27524)","author":{"url":"https://github.com/KSXGitHub","@type":"Person","name":"KSXGitHub"},"datePublished":"2018-10-03T12:18:01Z","url":"https://github.com/microsoft/TypeScript/issues/27525"}

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:0b057d58-4d12-eca7-14fc-17c083ca1a90
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC50C:34B9D4:6BE6E8:991993:6B04704C
html-safe-nonce64be848374784061f96c91aadc0ec941fe7bda8a554b86ba43645d3acd9f0c06
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTBDOjM0QjlENDo2QkU2RTg6OTkxOTkzOjZCMDQ3MDRDIiwidmlzaXRvcl9pZCI6IjI4MTQ5ODg5NzE3ODk4MDQyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0a60388e6ee7a333b54742b7461ba00ee059d2b6a5c980aa4521ea0cb2a4a0d3
hovercard-subject-tagissue:366311416
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/27525/issue_layout
twitter:imagehttps://opengraph.githubassets.com/65e994f551f1e9dbf69844be696ef2a56f18c1072f367f6d78b951df8b0e8025/microsoft/TypeScript/issues/27525
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/65e994f551f1e9dbf69844be696ef2a56f18c1072f367f6d78b951df8b0e8025/microsoft/TypeScript/issues/27525
og:image:altSearch Terms Suggestion Use this: declare function Symbol (x?: string | number): symbol declare namespace Symbol { const prototype: symbol const iterator: unique symbol } Or this: interface SymbolC...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameKSXGitHub
hostnamegithub.com
expected-hostnamegithub.com
Noneae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f
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
releasecfb5f24c6e01d85f70804652a5107e5cac03a161
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/27525#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F27525
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%2F27525
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/27525
Reloadhttps://github.com/microsoft/TypeScript/issues/27525
Reloadhttps://github.com/microsoft/TypeScript/issues/27525
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/27525
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/27525
#42543https://github.com/microsoft/TypeScript/pull/42543
Make Symbol.* (e.g. Symbol.iterator) unique symbolshttps://github.com/microsoft/TypeScript/issues/27525#top
#42543https://github.com/microsoft/TypeScript/pull/42543
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/KSXGitHub
Khải (KSXGitHub)https://github.com/KSXGitHub
on Oct 3, 2018https://github.com/microsoft/TypeScript/issues/27525#issue-366311416
Playground Linkhttps://www.typescriptlang.org/play/#src=declare%20function%20FakeSymbol%20()%3A%20symbol%0D%0A%0D%0Adeclare%20namespace%20FakeSymbol%20%7B%0D%0A%20%20const%20prototype%3A%20symbol%0D%0A%20%20const%20iterator%3A%20unique%20symbol%0D%0A%7D%0D%0A%0D%0Aconst%20iterator%3A%20typeof%20FakeSymbol.iterator%20%3D%20FakeSymbol.iterator%0D%0A%0D%0Aconst%20foo%3A%20%7B%0D%0A%20%20%5BFakeSymbol.iterator%5D%3A%20number%0D%0A%7D%20%3D%20%7B%0D%0A%20%20%5Biterator%5D%3A%20123%0D%0A%7D%0D%0A
Thishttps://www.typescriptlang.org/play/#src=interface%20FakeSymbolConstructor%20%7B%0D%0A%20%20(x%3F%3A%20number%20%7C%20string)%3A%20symbol%0D%0A%20%20readonly%20prototype%3A%20symbol%0D%0A%20%20readonly%20iterator%3A%20unique%20symbol%0D%0A%7D%0D%0A%0D%0Adeclare%20const%20FakeSymbol%3A%20FakeSymbolConstructor%0D%0A%0D%0Aconst%20iterator%3A%20typeof%20FakeSymbol.iterator%20%3D%20FakeSymbol.iterator%0D%0A%0D%0Aconst%20foo%3A%20%7B%0D%0A%20%20%5BFakeSymbol.iterator%5D%3A%20number%0D%0A%7D%20%3D%20%7B%0D%0A%20%20%5Biterator%5D%3A%20123%0D%0A%7D%0D%0A
Related Issuehttps://github.com/Microsoft/TypeScript/issues/27524
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Oct 3, 2018https://github.com/microsoft/TypeScript/issues/27525#event-1882634452
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Ron Buckton (rbuckton)https://github.com/rbuckton
on Oct 3, 2018https://github.com/microsoft/TypeScript/issues/27525#event-1882634538
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Oct 3, 2018https://github.com/microsoft/TypeScript/issues/27525#issuecomment-426740009
Ron Buckton (@rbuckton)https://github.com/rbuckton
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Oct 3, 2018https://github.com/microsoft/TypeScript/issues/27525#issuecomment-426745238
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Oct 3, 2018https://github.com/microsoft/TypeScript/issues/27525#issuecomment-426793256
#24738https://github.com/microsoft/TypeScript/pull/24738
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Oct 4, 2018https://github.com/microsoft/TypeScript/issues/27525#event-1883619097
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
on Oct 4, 2018https://github.com/microsoft/TypeScript/issues/27525#event-1883619189
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 3.2https://github.com/microsoft/TypeScript/milestone/77
TypeScript 3.2.1https://github.com/microsoft/TypeScript/milestone/84
on Nov 13, 2018https://github.com/microsoft/TypeScript/issues/27525#event-1964087229
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 3.2.1https://github.com/microsoft/TypeScript/milestone/84
TypeScript 3.3.0https://github.com/microsoft/TypeScript/milestone/79
on Nov 29, 2018https://github.com/microsoft/TypeScript/issues/27525#event-1994046209
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.3https://github.com/microsoft/TypeScript/milestone/79
on Feb 1, 2019https://github.com/microsoft/TypeScript/issues/27525#event-2113053863
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Mar 14, 2019https://github.com/microsoft/TypeScript/issues/27525#event-2204257318
https://github.com/ExE-Boss
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Jan 3, 2020https://github.com/microsoft/TypeScript/issues/27525#issuecomment-570699390
#24738https://github.com/microsoft/TypeScript/pull/24738
Alexis Tyler (OmgImAlexis)https://github.com/OmgImAlexis
on Feb 13, 2020https://github.com/microsoft/TypeScript/issues/27525#event-3033197919
Supress error TS2322 see microsoft/TypeScript#27525https://github.com/OmgImAlexis/subscriptions-transport-ws/commit/78f574b1d694e935e400153ccd2c1054a730e887
microsoft/TypeScript#27525https://github.com/microsoft/TypeScript/issues/27525
78f574bhttps://github.com/OmgImAlexis/subscriptions-transport-ws/commit/78f574b1d694e935e400153ccd2c1054a730e887
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Ron Buckton (rbuckton)https://github.com/rbuckton
on Jul 20, 2020https://github.com/microsoft/TypeScript/issues/27525#event-3567824677
Wesley Wigham (weswigham)https://github.com/weswigham
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#42543https://github.com/microsoft/TypeScript/pull/42543
on Feb 22, 2021https://github.com/microsoft/TypeScript/issues/27525#event-4362296197
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/27525#event-20415814851
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/27525
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/27525
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
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.