René's URL Explorer Experiment


Title: Syntax error in emitted declaration's generic arguments · Issue #42079 · microsoft/TypeScript · GitHub

Open Graph Title: Syntax error in emitted declaration's generic arguments · Issue #42079 · microsoft/TypeScript

X Title: Syntax error in emitted declaration's generic arguments · Issue #42079 · microsoft/TypeScript

Description: Bug Report 🔎 Search Terms syntax error declaration emit generics "Cannot find name" ts2304 🕗 Version & Regression Information This is syntactically incorrect output from tsc It is not a regression This is the behavior in every version I ...

Open Graph Description: Bug Report 🔎 Search Terms syntax error declaration emit generics "Cannot find name" ts2304 🕗 Version & Regression Information This is syntactically incorrect output from tsc It is not a regression ...

X Description: Bug Report 🔎 Search Terms syntax error declaration emit generics "Cannot find name" ts2304 🕗 Version & Regression Information This is syntactically incorrect output from tsc It is not...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Syntax error in emitted declaration's generic arguments","articleBody":"# Bug Report\r\n\r\n### 🔎 Search Terms\r\n\r\nsyntax error declaration emit generics \"Cannot find name\" ts2304\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This is syntactically incorrect output from tsc\r\n- It is not a regression\r\n- This is the behavior in every version I tried (3.3 - 4.2.0-dev.20201222)\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/dev/bug-workbench/?ts=4.2.0-dev.20201222#code/PTAEAEBMFMGMBsCGAnRAXAlgewHYCgQJF54sB3AKQGcAuUAM2KujwLHHo3mh0QFtodPogw4AdGip40ATwAO0UAHVUcgDwBBAHygAvKADeeUCdA5oVNHQ14AvgG48otNGSNYigArJoANx5oAJI48KKiAObBACJwSKiYuACifBhohnZ40AAecljIabIKoJ4ArgBGobAqiOoAGgA0oACaeoa2OvrV6k06AGTFPv44QSFhOJE4MQgo6Ng4yamO2bn5DCU4sAk4DDhqACo6ABQo4XR7AJSgdKUVGFWq+zpGpqA+aCXI2wZmFlagJ6BbBlYLhLD9LNBIK16DhDt96FgsHQAIy2c72UyEADKMmGiCyoESyGQeVAolAMGm8TmoGgKTSAAtXCxlnk0jBGCV4GlzBDII4gA)\r\n\r\n**Important:** The playground itself has a rendering bug in the display of the declaration.  It still looks invalid.  But it's invalid in another way in the truthful output.  I paste the truthful output below.\r\n\r\n### 💻 Code\r\n\r\n```ts\r\n// @declaration\r\ntype Wrap\u003cA> = {\r\n    nest: A\r\n};\r\ninterface PreventInliningInDeclarationEmit {\r\n}\r\nexport type PublicWrap\u003cX, Y = {}> = Wrap\u003cY> & PreventInliningInDeclarationEmit;\r\nexport function fn\u003cT> (arg: T) : PublicWrap\u003cT> {\r\n    return { nest: arg }\r\n}\r\nconst nested = fn({ foo: 1});   // Syntax Error in declaration emit here\r\nexport default nested;\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nEmitted declaration has syntax error.  `Cannot find name 'T'. (ts2304)`\r\n\r\n```ts\r\ndeclare type Wrap\u003cA> = {\r\n    nest: A;\r\n};\r\ninterface PreventInliningInDeclarationEmit {\r\n}\r\nexport declare type PublicWrap\u003cX, Y = {}> = Wrap\u003cY> & PreventInliningInDeclarationEmit;\r\nexport declare function fn\u003cT>(arg: T): PublicWrap\u003cT>;\r\ndeclare const nested: PublicWrap\u003cT, {}>;\r\nexport default nested;\r\n```\r\n\r\n### 🙂 Expected behavior\r\n\r\nA valid declaration.\r\n\r\n```ts\r\ndeclare type Wrap\u003cA> = {\r\n    nest: A;\r\n};\r\ninterface PreventInliningInDeclarationEmit {\r\n}\r\nexport declare type PublicWrap\u003cX, Y = {}> = Wrap\u003cY> & PreventInliningInDeclarationEmit;\r\nexport declare function fn\u003cT>(arg: T): PublicWrap\u003cT>;\r\ndeclare const nested: PublicWrap\u003c{\r\n    foo: number;\r\n}>;\r\nexport default nested;\r\n```\r\n\r\n","author":{"url":"https://github.com/robpalme","@type":"Person","name":"robpalme"},"datePublished":"2020-12-22T18:38:04Z","url":"https://github.com/microsoft/TypeScript/issues/42079"}

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:6c8a45eb-9004-4418-01b0-3c2f77caff09
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id83D6:DB09F:29DBCB9:356C6B2:6B01AFBF
html-safe-nonce06cdca181d9e89468b70af26bf0f3e8aaf294e50542fdff118f4e38e27a87254
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0Q2OkRCMDlGOjI5REJDQjk6MzU2QzZCMjo2QjAxQUZCRiIsInZpc2l0b3JfaWQiOiI1Njg4ODc0ODUxODMwNDQzOTY3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca43750d552e1fc5b7a09e026bf936e4812d587799c725255318fa9a98b869c5b
hovercard-subject-tagissue:773162114
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/42079/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8c41dec594682036aa119a17b3267fa98881229429a0e6eee90cb0ef2007fdcd/microsoft/TypeScript/issues/42079
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8c41dec594682036aa119a17b3267fa98881229429a0e6eee90cb0ef2007fdcd/microsoft/TypeScript/issues/42079
og:image:altBug Report 🔎 Search Terms syntax error declaration emit generics "Cannot find name" ts2304 🕗 Version & Regression Information This is syntactically incorrect output from tsc It is not a regression ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerobpalme
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/42079#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F42079
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%2F42079
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/42079
Reloadhttps://github.com/microsoft/TypeScript/issues/42079
Reloadhttps://github.com/microsoft/TypeScript/issues/42079
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)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/42079
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/42079
Syntax error in emitted declaration's generic argumentshttps://github.com/microsoft/TypeScript/issues/42079#top
https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
RescheduledThis issue was previously scheduled to an earlier milestonehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Rescheduled%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/robpalme
Rob Palmer (robpalme)https://github.com/robpalme
on Dec 22, 2020https://github.com/microsoft/TypeScript/issues/42079#issue-773162114
Playground link with relevant codehttps://www.typescriptlang.org/dev/bug-workbench/?ts=4.2.0-dev.20201222#code/PTAEAEBMFMGMBsCGAnRAXAlgewHYCgQJF54sB3AKQGcAuUAM2KujwLHHo3mh0QFtodPogw4AdGip40ATwAO0UAHVUcgDwBBAHygAvKADeeUCdA5oVNHQ14AvgG48otNGSNYigArJoANx5oAJI48KKiAObBACJwSKiYuACifBhohnZ40AAecljIabIKoJ4ArgBGobAqiOoAGgA0oACaeoa2OvrV6k06AGTFPv44QSFhOJE4MQgo6Ng4yamO2bn5DCU4sAk4DDhqACo6ABQo4XR7AJSgdKUVGFWq+zpGpqA+aCXI2wZmFlagJ6BbBlYLhLD9LNBIK16DhDt96FgsHQAIy2c72UyEADKMmGiCyoESyGQeVAolAMGm8TmoGgKTSAAtXCxlnk0jBGCV4GlzBDII4gA
Nexthttps://github.com/microsoft/TypeScript/issues/42079?timeline_page=1
https://github.com/dragomirtitian
Titian Cernicova-Dragomir (dragomirtitian)https://github.com/dragomirtitian
on Dec 22, 2020https://github.com/microsoft/TypeScript/issues/42079#issuecomment-749726572
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Dec 22, 2020https://github.com/microsoft/TypeScript/issues/42079#event-4141462214
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Wesley Wigham (weswigham)https://github.com/weswigham
on Dec 22, 2020https://github.com/microsoft/TypeScript/issues/42079#event-4141462315
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 4.2.0https://github.com/microsoft/TypeScript/milestone/129
on Dec 22, 2020https://github.com/microsoft/TypeScript/issues/42079#event-4141462408
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
on Dec 22, 2020https://github.com/microsoft/TypeScript/issues/42079#event-4141464434
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
on Jan 4, 2021https://github.com/microsoft/TypeScript/issues/42079#event-4167205435
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 4.2.0https://github.com/microsoft/TypeScript/milestone/129
TypeScript 4.2.1https://github.com/microsoft/TypeScript/milestone/131
on Jan 20, 2021https://github.com/microsoft/TypeScript/issues/42079#event-4229814419
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
RescheduledThis issue was previously scheduled to an earlier milestonehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Rescheduled%22
on Mar 4, 2021https://github.com/microsoft/TypeScript/issues/42079#event-4410777202
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 4.2.1https://github.com/microsoft/TypeScript/milestone/131
TypeScript 4.3.0https://github.com/microsoft/TypeScript/milestone/134
on Mar 4, 2021https://github.com/microsoft/TypeScript/issues/42079#event-4410778510
Andrew Branch (andrewbranch)https://github.com/andrewbranch
TypeScript 4.3.0https://github.com/microsoft/TypeScript/milestone/134
TypeScript 4.3.1https://github.com/microsoft/TypeScript/milestone/138
on Apr 2, 2021https://github.com/microsoft/TypeScript/issues/42079#event-4546274017
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 4.3.1https://github.com/microsoft/TypeScript/milestone/138
TypeScript 4.4.1 (RC)https://github.com/microsoft/TypeScript/milestone/144
on Jun 18, 2021https://github.com/microsoft/TypeScript/issues/42079#event-4910936070
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 4.6.1https://github.com/microsoft/TypeScript/milestone/158
TypeScript 4.8.0https://github.com/microsoft/TypeScript/milestone/163
on May 13, 2022https://github.com/microsoft/TypeScript/issues/42079#event-6607999764
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 4.8.0https://github.com/microsoft/TypeScript/milestone/163
TypeScript 5.1.0https://github.com/microsoft/TypeScript/milestone/178
on Feb 1, 2023https://github.com/microsoft/TypeScript/issues/42079#event-8413670732
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 5.1.0https://github.com/microsoft/TypeScript/milestone/178
TypeScript 5.5.0https://github.com/microsoft/TypeScript/milestone/179
on Mar 4, 2024https://github.com/microsoft/TypeScript/issues/42079#event-12004966036
https://github.com/MichaelMitchell-at
michaelm (MichaelMitchell-at)https://github.com/MichaelMitchell-at
on Jun 10, 2024https://github.com/microsoft/TypeScript/issues/42079#issuecomment-2156982951
#58807https://github.com/microsoft/TypeScript/issues/58807
Wesley Wigham (weswigham)https://github.com/weswigham
TypeScript 5.5.0https://github.com/microsoft/TypeScript/milestone/179
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Jun 11, 2024https://github.com/microsoft/TypeScript/issues/42079#event-13120295536
Jake Bailey (jakebailey)https://github.com/jakebailey
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
on Aug 20, 2026https://github.com/microsoft/TypeScript/issues/42079#event-29770176880
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 6, 2026https://github.com/microsoft/TypeScript/issues/42079#issuecomment-5556345054
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
Needs Human ReviewThis issue has a backlog check awaiting maintainer review.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Human%20Review%22
on Sep 6, 2026https://github.com/microsoft/TypeScript/issues/42079#event-30627633383
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 6, 2026https://github.com/microsoft/TypeScript/issues/42079#event-30627633686
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs Human ReviewThis issue has a backlog check awaiting maintainer review.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Human%20Review%22
on Sep 23, 2026https://github.com/microsoft/TypeScript/issues/42079#event-31702005495
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/42079
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/42079
Wesley Wigham (weswigham)https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: Declaration EmitThe issue relates to the emission of d.ts fileshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20Declaration%20Emit%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
RescheduledThis issue was previously scheduled to an earlier milestonehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Rescheduled%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

Viewport: width=device-width


URLs of crawlers that visited me.