René's URL Explorer Experiment


Title: Default generic type variables · Issue #2175 · microsoft/TypeScript · GitHub

Open Graph Title: Default generic type variables · Issue #2175 · microsoft/TypeScript

X Title: Default generic type variables · Issue #2175 · microsoft/TypeScript

Description: It would be really useful if I could set default values for my generic type variables. In many cases, the users of my class don't want to use a different value and so it's cumbersome to having to type it in. If I could do this: class MyC...

Open Graph Description: It would be really useful if I could set default values for my generic type variables. In many cases, the users of my class don't want to use a different value and so it's cumbersome to having to t...

X Description: It would be really useful if I could set default values for my generic type variables. In many cases, the users of my class don't want to use a different value and so it's cumbersome to hav...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Default generic type variables","articleBody":"It would be really useful if I could set default values for my generic type variables. In many cases, the users of my class don't want to use a different value and so it's cumbersome to having to type it in.\n\nIf I could do this:\n\n``` typescript\nclass MyClass\u003cT = String>\n{\npublic userData: T;\nconstructor() {}\n}\n```\n\nthen the people who don't care about the type of `userData` (because they don't use it) and the people who are fine with it being a `String` don't have to set a generic type but others can if they want.\n\nAlso, these type variables could default to `any` or the type they extend (if they do) without explicitly defaulting them.\nFor example:\n`\u003cT extends MyClass>` would default to `MyClass` (without explicitly writing it)\nand\n`\u003cT>` could default to `any`\n\nWhat do you think?\n","author":{"url":"https://github.com/andrewvarga","@type":"Person","name":"andrewvarga"},"datePublished":"2015-03-01T11:14:01Z","url":"https://github.com/microsoft/TypeScript/issues/2175"}

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:b3f0804a-ac31-62ed-e3f1-a1b7c6eabfd6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAC20:142A23:536C58:707F9B:6AFBF31C
html-safe-noncedbe4955c1e83bce00c4255f9a2b485ff2dacd0fe9cca9957dceb81fa400d1cfb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzIwOjE0MkEyMzo1MzZDNTg6NzA3RjlCOjZBRkJGMzFDIiwidmlzaXRvcl9pZCI6IjgxNDM4NjI5MTEwODk3NjcxOTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacdec1849302222d08e864f9eac89b5fcb9dc8d6b7892811134994e6f15300ea70
hovercard-subject-tagissue:59392178
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/2175/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3abd381ebd9d3e4138bd8fb299fb8bd6853217044ebcab2d242fb5bba4b2801d/microsoft/TypeScript/issues/2175
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3abd381ebd9d3e4138bd8fb299fb8bd6853217044ebcab2d242fb5bba4b2801d/microsoft/TypeScript/issues/2175
og:image:altIt would be really useful if I could set default values for my generic type variables. In many cases, the users of my class don't want to use a different value and so it's cumbersome to having to t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameandrewvarga
hostnamegithub.com
expected-hostnamegithub.com
Nonefa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f
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
releaseb3b5633a74535d9c23385512d534c66c8fde1907
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/2175#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F2175
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%2F2175
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/2175
Reloadhttps://github.com/microsoft/TypeScript/issues/2175
Reloadhttps://github.com/microsoft/TypeScript/issues/2175
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests335 (335)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/pulse
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/2175
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/2175
#13487https://github.com/microsoft/TypeScript/pull/13487
Default generic type variableshttps://github.com/microsoft/TypeScript/issues/2175#top
#13487https://github.com/microsoft/TypeScript/pull/13487
https://github.com/rbuckton
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.3https://github.com/microsoft/TypeScript/milestone/38
https://github.com/andrewvarga
Andrew Varga (andrewvarga)https://github.com/andrewvarga
on Mar 1, 2015https://github.com/microsoft/TypeScript/issues/2175#issue-59392178
Nexthttps://github.com/microsoft/TypeScript/issues/2175?timeline_page=1
Andrew Varga (andrewvarga)https://github.com/andrewvarga
on Mar 1, 2015https://github.com/microsoft/TypeScript/issues/2175#event-243936465
https://github.com/fdecampredon
François de Campredon (fdecampredon)https://github.com/fdecampredon
on Mar 2, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-76743530
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Mar 2, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-76775835
Dan Quirk (danquirk)https://github.com/danquirk
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Proposal%22
on Mar 2, 2015https://github.com/microsoft/TypeScript/issues/2175#event-244702944
https://github.com/andrewvarga
Andrew Varga (andrewvarga)https://github.com/andrewvarga
on Mar 3, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-77047493
François de Campredon (@fdecampredon)https://github.com/fdecampredon
https://github.com/mdekrey
Matt DeKrey (mdekrey)https://github.com/mdekrey
on Apr 1, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-88601570
https://github.com/poeschko
Jan Pöschko (poeschko)https://github.com/poeschko
on Jun 26, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-115733286
https://github.com/andrewvarga
Andrew Varga (andrewvarga)https://github.com/andrewvarga
on Aug 5, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-128069466
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Aug 5, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-128086749
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Aug 5, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-128089120
https://github.com/andrewvarga
Andrew Varga (andrewvarga)https://github.com/andrewvarga
on Aug 5, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-128165556
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/andrewvarga
Andrew Varga (andrewvarga)https://github.com/andrewvarga
on Aug 5, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-128165663
Tingan Ho (@tinganho)https://github.com/tinganho
https://github.com/mdekrey
Matt DeKrey (mdekrey)https://github.com/mdekrey
on Aug 6, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-128524410
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
Tingan Ho (@tinganho)https://github.com/tinganho
https://github.com/Andael
Andaelhttps://github.com/Andael
on Aug 8, 2015https://github.com/microsoft/TypeScript/issues/2175#issuecomment-129032207
Matt DeKrey (@mdekrey)https://github.com/mdekrey
https://github.com/Artazor
Anatoly Ressin (Artazor)https://github.com/Artazor
on Jan 9, 2017https://github.com/microsoft/TypeScript/issues/2175#issuecomment-271202283
https://github.com/dead-claudia
Claudia Meadows (dead-claudia)https://github.com/dead-claudia
on Jan 9, 2017https://github.com/microsoft/TypeScript/issues/2175#issuecomment-271210554
Anatoly Ressin (@Artazor)https://github.com/Artazor
https://github.com/gcnew
Marin Marinov (gcnew)https://github.com/gcnew
on Jan 23, 2017https://github.com/microsoft/TypeScript/issues/2175#issuecomment-274532726
#1213https://github.com/microsoft/TypeScript/issues/1213
#9949https://github.com/microsoft/TypeScript/issues/9949
Blake Embrey (@blakeembrey)https://github.com/blakeembrey
https://github.com/dead-claudia
Claudia Meadows (dead-claudia)https://github.com/dead-claudia
on Jan 25, 2017https://github.com/microsoft/TypeScript/issues/2175#issuecomment-275240154
Marin Marinov (@gcnew)https://github.com/gcnew
Blake Embrey (@blakeembrey)https://github.com/blakeembrey
nested types make ithttps://github.com/Microsoft/TypeScript/issues/9889
https://github.com/bcherny
Boris Cherny (bcherny)https://github.com/bcherny
on Feb 8, 2017https://github.com/microsoft/TypeScript/issues/2175#issuecomment-278442851
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 8, 2017https://github.com/microsoft/TypeScript/issues/2175#issuecomment-278453271
Boris Cherny (@bcherny)https://github.com/bcherny
#13487https://github.com/microsoft/TypeScript/pull/13487
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Feb 8, 2017https://github.com/microsoft/TypeScript/issues/2175#event-954519280
https://github.com/bcherny
Boris Cherny (bcherny)https://github.com/bcherny
on Feb 8, 2017https://github.com/microsoft/TypeScript/issues/2175#issuecomment-278457393
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
Ron Buckton (rbuckton)https://github.com/rbuckton
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#13487https://github.com/microsoft/TypeScript/pull/13487
on Feb 15, 2017https://github.com/microsoft/TypeScript/issues/2175#event-962471100
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.3https://github.com/microsoft/TypeScript/milestone/38
on Feb 15, 2017https://github.com/microsoft/TypeScript/issues/2175#event-962510374
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Feb 15, 2017https://github.com/microsoft/TypeScript/issues/2175#event-962510446
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Ron Buckton (rbuckton)https://github.com/rbuckton
on Feb 15, 2017https://github.com/microsoft/TypeScript/issues/2175#event-962510541
https://github.com/iamssen
Seo Yeon, Lee (iamssen)https://github.com/iamssen
on Feb 16, 2017https://github.com/microsoft/TypeScript/issues/2175#issuecomment-280204391
microsofthttps://github.com/microsoft
on Jun 18, 2018https://github.com/microsoft/TypeScript/issues/2175#event-1686923688
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/2175
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/2175
Ron Buckton (rbuckton)https://github.com/rbuckton
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 2.3https://github.com/microsoft/TypeScript/milestone/38
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.