Title: [transpileDeclaration API][5.5] Incorrectly creates new alias for generic parameter · Issue #58512 · microsoft/TypeScript · GitHub
Open Graph Title: [transpileDeclaration API][5.5] Incorrectly creates new alias for generic parameter · Issue #58512 · microsoft/TypeScript
X Title: [transpileDeclaration API][5.5] Incorrectly creates new alias for generic parameter · Issue #58512 · microsoft/TypeScript
Description: 🔎 Search Terms transpiledeclaration api alias generic parameter name 🕗 Version & Regression Information This changed in commit or PR #58261 Wesley Wigham (@weswigham) ⏯ Playground Link https://www.typescriptlang.org/dev/bug-workbench/?ta...
Open Graph Description: 🔎 Search Terms transpiledeclaration api alias generic parameter name 🕗 Version & Regression Information This changed in commit or PR #58261 Wesley Wigham (@weswigham) ⏯ Playground Link https://www....
X Description: 🔎 Search Terms transpiledeclaration api alias generic parameter name 🕗 Version & Regression Information This changed in commit or PR #58261 Wesley Wigham (@weswigham) ⏯ Playground Link https://...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/58512
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[transpileDeclaration API][5.5] Incorrectly creates new alias for generic parameter","articleBody":"### 🔎 Search Terms\n\ntranspiledeclaration api alias generic parameter name\n\n### 🕗 Version & Regression Information\n\n- This changed in commit or PR https://github.com/microsoft/TypeScript/pull/58261 @weswigham \n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/dev/bug-workbench/?target=7&ts=5.5.0-dev.20240512#code/PTAEAEGcBcCcEsDG0Bco4FcCmAoEEATLRAGwENYzp4B7AOzU13ygAsaB3AUQFt5o8YNp179oWAgDF4JLGjIA6AguiRBESO259o4qTLmgARkpVr14AGYG6ZHocWqcWAB4AHGrGjoAnm6ygAErEngQAPADSWD6gruJ0BJCgMAh0AOYANKAAamQk2AB8oAC8oADeOKCgANoRoPB0oFE+ALpouflYANw4AL49FtaytvZoJk7wPB5e5UEhsASgvaCWsDQ8oABECsBkmz2u097QfgGSNDSRsS7xiclwDWlFpcGIoZFZdBg8RliwBQNDp5vG86DBQDQjAArErlSqgAg0AAqrEeVziWASSRSjwKAAoAPoAazQEQAlGhzpcIkUKlUqrAsNAMLBGmVlmQkmQ6D4elVehk+j0gA\n\n### 💻 Code\n\n```ts\r\n// @strict: true\r\n// @declaration: true\r\n// @showEmit\r\n// @showEmittedFile: a.d.ts\r\n// @showEmittedFile: b.d.ts\r\n\r\n// @filename: a.ts\r\nexport type Record\u003cKey extends string, Value> = {\r\n [K in Key]: Value;\r\n};\r\n\r\n// @filename: b.ts\r\nimport { Record } from \"./a\";\r\nexport type Foo\u003cK extends string> = Record\u003cK, number>;\r\n\r\nexport const obj = {\r\n doThing\u003cK extends string>(_k: K): Foo\u003cK> {\r\n return {} as any;\r\n },\r\n};\r\n```\r\n\n\n### 🙁 Actual behavior\n\nWhen using the API, `b.d.ts` is emitted as\r\n```ts\r\nimport { Record } from \"./a\";\r\nexport type Foo\u003cK extends string> = Record\u003cK, number>;\r\nexport declare const obj: {\r\n doThing\u003cK extends string>(_k: K): Record\u003cK_1, number>;\r\n};\r\n```\r\nwhile when using `tsc` it gets emitted as\r\n```ts\r\nimport { Record } from \"./a\";\r\nexport type Foo\u003cK extends string> = Record\u003cK, number>;\r\nexport declare const obj: {\r\n doThing\u003cK extends string>(_k: K): Foo\u003cK>;\r\n};\r\n```\n\n### 🙂 Expected behavior\n\nUsing the API should emit\r\n```ts\r\nimport { Record } from \"./a\";\r\nexport type Foo\u003cK extends string> = Record\u003cK, number>;\r\nexport declare const obj: {\r\n doThing\u003cK extends string>(_k: K): Foo\u003cK>;\r\n};\r\n```\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/MichaelMitchell-at","@type":"Person","name":"MichaelMitchell-at"},"datePublished":"2024-05-13T05:38:26Z","url":"https://github.com/microsoft/TypeScript/issues/58512"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4b4db176-c80d-b9c8-c5dc-5ab13755bd4a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D408:2E3FEE:352F783:435CBA8:6B01DD8B |
| html-safe-nonce | 01c18c6874f65e5c3a6612577f09a91c2645fa0d11627712118bafbc99c1b30d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDA4OjJFM0ZFRTozNTJGNzgzOjQzNUNCQTg6NkIwMUREOEIiLCJ2aXNpdG9yX2lkIjoiOTA2NjMyOTkxODEzNjI0NTY0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f741fba36f2d78cb7ace8c58a2e6522790c0544b07a460dfe1d6df9619ad223b |
| hovercard-subject-tag | issue:2291867701 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/58512/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c8d20364b725fa91eda047d21404197938180e7b7293a33611f01de0a7e252af/microsoft/TypeScript/issues/58512 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c8d20364b725fa91eda047d21404197938180e7b7293a33611f01de0a7e252af/microsoft/TypeScript/issues/58512 |
| og:image:alt | 🔎 Search Terms transpiledeclaration api alias generic parameter name 🕗 Version & Regression Information This changed in commit or PR #58261 Wesley Wigham (@weswigham) ⏯ Playground Link https://www.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MichaelMitchell-at |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width