Title: Surprising circularity when parameter within base type expression refers to the class itself · Issue #58391 · microsoft/TypeScript · GitHub
Open Graph Title: Surprising circularity when parameter within base type expression refers to the class itself · Issue #58391 · microsoft/TypeScript
X Title: Surprising circularity when parameter within base type expression refers to the class itself · Issue #58391 · microsoft/TypeScript
Description: 🔎 Search Terms circularity base expression class single call signature callback parameters 🕗 Version & Regression Information This is the behavior in every version I tried ⏯ Playground Link https://www.typescriptlang.org/play/?ts=5.5.0-d...
Open Graph Description: 🔎 Search Terms circularity base expression class single call signature callback parameters 🕗 Version & Regression Information This is the behavior in every version I tried ⏯ Playground Link https:/...
X Description: 🔎 Search Terms circularity base expression class single call signature callback parameters 🕗 Version & Regression Information This is the behavior in every version I tried ⏯ Playground Link htt...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/58391
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Surprising circularity when parameter within base type expression refers to the class itself","articleBody":"### 🔎 Search Terms\n\ncircularity base expression class single call signature callback parameters\n\n### 🕗 Version & Regression Information\n\n- This is the behavior in every version I tried\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?ts=5.5.0-dev.20240501#code/JYOwLgpgTgZghgYwgAgApQmMBPAPAFQHsA+ZAbwChlkAKOALmSIEpGBnMKUAcwG4KAvhQqhIsRCgDKCABYQAtnFwBBUpWoY4AE0IgANtmQAHDFmwB+Rukw4VxfkJHho8JMgDCeuGzZ3yVZBAIAHdaVmRlB2EtCAQvDGQEXQ4PLx9GXEkIPRhiGgDgGPBgGGBodk4eABoKZmQAXlJcADEyvS02PIDS7I7GVt62Guo4EBBCMDgwYGTLZGk5RUzs3Jq6xtTvXwB5AFcwI33mqEJ5FraO4nthHCMUfGw7gj2D-dJ6-2oAfXwXw7BGL99v8HPwKLcUH8jiczvgBu1Og1PsgANoAaWQoGQAGsINhCDAmPCOgBdRgAIh+ULA5OQEAAHpAQB0cXiCUSLmx0SSAtRzBzBtyUZSga8aTzqNRGEEAG7QUHRWLxFAwXYgBDTXTIDhcEDcGjhB5PHU8a4UBlGQhQMCJNJsCJ0xkQZn2zxbOw0cnKcnMfLUMjIBjayp65ACYbI6gmGzYRh0dakABSkm2ADkAHQmvUlbDxiPh2rkARAA\n\n### 💻 Code\n\n```ts\r\ninterface Pretty\u003cTo> {\r\n (a: To): string;\r\n}\r\n\r\ninterface Schema\u003cA> {\r\n readonly pretty?: Pretty\u003cA>;\r\n}\r\n\r\ninterface Class\u003cA> {\r\n new (): A;\r\n}\r\n\r\ndeclare const Class: \u003cSelf>(\r\n identifier: string,\r\n) => \u003cFields>(\r\n fields: Fields,\r\n annotations?: Schema\u003cSelf>,\r\n) => Class\u003cOutputFrom\u003cFields>>;\r\n\r\ntype Type\u003cTOutput> = {\r\n _TOutput: TOutput;\r\n};\r\n\r\ntype OutputFrom\u003cTFields> = {\r\n [K in keyof TFields]: \"_TOutput\" extends keyof TFields[K]\r\n ? TFields[K][\"_TOutput\"]\r\n : never;\r\n};\r\n\r\ndeclare function string(): Type\u003cstring>;\r\n\r\nexport class A extends Class\u003cA>(\"A\")(\r\n { a: string },\r\n {\r\n pretty: (a) => JSON.stringify(a),\r\n },\r\n) {}\r\n```\r\n\n\n### 🙁 Actual behavior\n\n```\r\nType 'A' recursively references itself as a base type.(2310)\r\n'A' is referenced directly or indirectly in its own base expression.(2506)\r\n```\n\n### 🙂 Expected behavior\n\nNo error. Correct declarations can be emitted for this without any problems\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/Andarist","@type":"Person","name":"Andarist"},"datePublished":"2024-05-01T20:14:33Z","url":"https://github.com/microsoft/TypeScript/issues/58391"}
| 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:5e96eb51-3cf0-bd1b-b4b0-adb260811d80 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EEC:3A347:C7EE3D:10A450D:6B00F6E6 |
| html-safe-nonce | 55a6b82a48322f82c5b1ed72e58f17792e4e431751f5b893543ee81d18ce932d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUVDOjNBMzQ3OkM3RUUzRDoxMEE0NTBEOjZCMDBGNkU2IiwidmlzaXRvcl9pZCI6IjM3ODMyNTQyNDY5MjU4NTg1MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3702d3da2ffbb716e14e212f96c044b074e0f8cabd1a6ac3962a1c2477fc7f68 |
| hovercard-subject-tag | issue:2274125596 |
| 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/58391/issue_layout |
| twitter:image | https://opengraph.githubassets.com/715e29247e8fc9133cb8c876d9e0a409d02f75ca1987f2beb11a7751f0a2bd49/microsoft/TypeScript/issues/58391 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/715e29247e8fc9133cb8c876d9e0a409d02f75ca1987f2beb11a7751f0a2bd49/microsoft/TypeScript/issues/58391 |
| og:image:alt | 🔎 Search Terms circularity base expression class single call signature callback parameters 🕗 Version & Regression Information This is the behavior in every version I tried ⏯ Playground Link https:/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Andarist |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width