René's URL Explorer Experiment


Title: 7.1 regression: bounded recursive types report TS5115 when inferred through a closure · Issue #65440 · microsoft/TypeScript · GitHub

Open Graph Title: 7.1 regression: bounded recursive types report TS5115 when inferred through a closure · Issue #65440 · microsoft/TypeScript

X Title: 7.1 regression: bounded recursive types report TS5115 when inferred through a closure · Issue #65440 · microsoft/TypeScript

Description: 🔎 Search Terms TS5115, TS2589, "appear infinitely circular", "excessively deep and possibly infinite", variance, closure, 4820 🕗 Version & Regression Information This changed between versions 7.1.0-dev.20260805.1 and 7.1.0-dev.20260806.1...

Open Graph Description: 🔎 Search Terms TS5115, TS2589, "appear infinitely circular", "excessively deep and possibly infinite", variance, closure, 4820 🕗 Version & Regression Information This changed between versions 7.1.0...

X Description: 🔎 Search Terms TS5115, TS2589, "appear infinitely circular", "excessively deep and possibly infinite", variance, closure, 4820 🕗 Version & Regression Information This change...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"7.1 regression: bounded recursive types report TS5115 when inferred through a closure","articleBody":"### 🔎 Search Terms\n\nTS5115, TS2589, \"appear infinitely circular\", \"excessively deep and possibly infinite\", variance, closure, 4820\n\n### 🕗 Version & Regression Information\n\n- This changed between versions `7.1.0-dev.20260805.1` and `7.1.0-dev.20260806.1`. The only commit between them is microsoft/typescript-go#4820 \"Order variance computation by associated type symbol\".\n- `7.1.0-dev.20260806.1` reports TS2589. Since #64372 (`7.1.0-dev.20260929.1`), the same error is reported as TS5115.\n- `7.0.2` and `7.1.0-dev.20260805.1` report nothing. Still present in `7.1.0-beta` and `7.1.0-dev.20261111.1`.\n- This is not the case of #64605: there is no base type argument that refers back to its own type, and the error starts before #64372.\n\n### ⏯ Playground Link\n\nRepository with every version pinned: https://github.com/RomainLanz/tsrs-type-issue (npm install && npm run check:all)\n\n### 💻 Code\n\nThe types are reduced from [@adonisjs/http-transformers](https://www.npmjs.com/package/@adonisjs/http-transformers) 2.3.1, with no dependencies. strict, target: esnext.\n\n```ts\ntype Prettify\u003cT> = { [K in keyof T]: T[K] } & {};\ntype ExtractUndefined\u003cT> = { [K in keyof T]: undefined extends T[K] ? K : never }[keyof T];\ntype ExtractDefined\u003cT> = { [K in keyof T]: undefined extends T[K] ? never : K }[keyof T];\ntype Next = [1, 2, 3, 4, 5, 6];\ntype JSONPrimitives = string | number | bigint | boolean | null | undefined;\ntype JSONValues = JSONPrimitives | CanBeSerialized\u003cany>;\ntype CanBeSerialized\u003cT extends JSONDataTypes> = {\n    toJSON(): T;\n};\ntype JSONDataTypes = JSONValues | JSONDataTypes[] | {\n    [key: string]: JSONDataTypes;\n};\ntype SerializeJSONObject\u003cT> = {\n    [K in ExtractDefined\u003cT>]: SerializeJSONTypes\u003cT[K]>;\n} & {\n    [K in ExtractUndefined\u003cT>]?: SerializeJSONTypes\u003cT[K]>;\n};\ninterface ExtendedJSONTypes {\n}\ntype NonAllowedJSTypes = Map\u003cany, any> | Set\u003cany>;\ntype ForcefullyAllowedTypes = {\n    [K in keyof ExtendedJSONTypes]: ExtendedJSONTypes[K];\n}[keyof ExtendedJSONTypes];\ntype SerializeJSONOwnTypes\u003cT> = T extends JSONPrimitives ? T : T extends ForcefullyAllowedTypes ? T : T extends NonAllowedJSTypes ? never : T extends Array\u003cinfer item> ? Array\u003cSerializeJSONTypes\u003citem>> : T extends object ? Prettify\u003cSerializeJSONObject\u003cT>> : never;\ntype SerializeJSONTypes\u003cT> = T extends ForcefullyAllowedTypes ? T : T extends CanBeSerialized\u003cinfer A> ? SerializeJSONOwnTypes\u003cA> : SerializeJSONOwnTypes\u003cT>;\ninterface ItemContract\u003cTransformer extends Record\u003cstring, any>, MaxDepth extends Next[number], Variant extends string> {\n    $type: 'item';\n    transformer: {\n        new (...args: any[]): Transformer;\n    };\n    maxDepth: MaxDepth;\n    variant: Variant;\n}\ntype UnpackKeyValue\u003cValue extends [any, any], MaxDepth extends number, Depth extends number> = [Value[0]] extends [never] ? SerializeJSONTypes\u003cValue[1]> : Value[0] extends ItemContract\u003cinfer Transformer, infer LocalMaxDepth, infer Variant> ? InferData\u003cTransformer, Variant, MaxDepth extends -1 ? LocalMaxDepth : MaxDepth, Next[Depth]> | SerializeJSONTypes\u003cValue[1]> : SerializeJSONTypes\u003cValue[1]>;\ntype LimitDepth\u003cKey, Value, MaxDepth extends number, Depth extends number> = [\n    Value\n] extends [never] ? Key : Value extends ItemContract\u003cany, any, any> ? MaxDepth extends Depth ? never : Key : Key;\ntype UnpackOptionalValues\u003cData, MaxDepth extends number, Depth extends number> = {\n    [O in {\n        [K in keyof Data]: [undefined] extends [Data[K]] ? LimitDepth\u003cK, SplitItm\u003cData[K]>[0], MaxDepth, Depth> : never;\n    }[keyof Data]]?: UnpackKeyValue\u003cSplitItm\u003cData[O]>, MaxDepth, Depth>;\n};\ntype UnpackRequiredValues\u003cData, MaxDepth extends number, Depth extends number> = {\n    [O in {\n        [K in keyof Data]: [undefined] extends [Data[K]] ? never : LimitDepth\u003cK, SplitItm\u003cData[K]>[0], MaxDepth, Depth>;\n    }[keyof Data]]: UnpackKeyValue\u003cSplitItm\u003cData[O]>, MaxDepth, Depth>;\n};\ntype SplitItm\u003cT> = [\n    Extract\u003cT, ItemContract\u003cany, any, any>>,\n    Exclude\u003cT, ItemContract\u003cany, any, any>>\n];\ntype UnpackAsTopLevelItem\u003cT, Wrapper extends string | undefined> = T extends ItemContract\u003cinfer Transformer, any, infer Variant> ? InferData\u003cTransformer, Variant, -1, 0> : never;\ntype UnpackValues\u003cData, MaxDepth extends number, Depth extends number> = Prettify\u003cUnpackRequiredValues\u003cData, MaxDepth, Depth> & UnpackOptionalValues\u003cData, MaxDepth, Depth>>;\ntype InferData\u003cTransformer, Variant extends string = 'toObject', MaxDepth extends number = -1, Depth extends number = 0> = Transformer extends {\n    [K in Variant]: (...args: any[]) => unknown;\n} ? UnpackValues\u003cAwaited\u003cReturnType\u003cTransformer[Variant]>>, MaxDepth, Depth> : never;\ndeclare class Item\u003cTransformer extends Record\u003cstring, any>, MaxDepth extends Next[number], Variant extends string> {\n\ttransformer: { new (...args: any[]): Transformer };\n\tmaxDepth: MaxDepth;\n\tvariant: Variant;\n\t$type: 'item';\n\tresolve(): Promise\u003cUnpackAsTopLevelItem\u003cthis, undefined>>;\n}\ntype Ctor = { new (resource: any, ...rest: any[]): any };\ndeclare abstract class BaseTransformer\u003cT> {\n\tstatic transform\u003cSelf extends Ctor>(this: Self, data: ConstructorParameters\u003cSelf>[0]): Item\u003cInstanceType\u003cSelf>, 1, 'toObject'>;\n\tconstructor(resource: T);\n}\nclass Size {\n}\nclass SizeTransformer extends BaseTransformer\u003cSize> {\n\ttoObject() {\n\t}\n}\ndeclare function once\u003cT>(value: T): T;\nonce(() => SizeTransformer.transform(new Size()));\n```\n\n\n### 🙁 Actual behavior\n\n```sh\nrepro.ts(76,12): error TS5115: Instantiations of the following types appear infinitely circular: 'InferData', 'UnpackKeyValue'.\n```\n\nWith 7.1.0-dev.20260806.1 to 7.1.0-dev.20260928.1:\n\n```sh\nrepro.ts(76,12): error TS2589: Type instantiation is excessively deep and possibly infinite.\n```\n\n### 🙂 Expected behavior\n\nNo error, as in 7.0.2 and 7.1.0-dev.20260805.1. The recursion is bounded: each `UnpackKeyValue` → `InferData` step advances `Depth` through `Next = [1, 2, 3, 4, 5, 6]`. `toObject()` here returns void, so there is not even a property to recurse into.\n\n### Additional information about the issue\n\nThe error depends on how the value reaches the generic call. Passing the `Item` directly checks without error on every version:\n\n```ts\nonce(() => SizeTransformer.transform(new Size())); // TS5115\nonce(SizeTransformer.transform(new Size()));       // no error\n```\n\nMy guess, not verified: microsoft/typescript-go#4820 restarts variance computations from the earliest declared symbol when it detects a circularity, and the inference of the closure's return type may now reach that restart through `InferData` and `UnpackKeyValue`. We found it on a real AdonisJS application; `tsrs`, which ports 7.1, reports the same error.","author":{"url":"https://github.com/RomainLanz","@type":"Person","name":"RomainLanz"},"datePublished":"2026-11-11T10:49:41Z","url":"https://github.com/microsoft/TypeScript/issues/65440"}

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:f340d184-a97d-ae4a-721f-5a8addda1049
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA3E4:1C6C3E:D2F4A0:11739D6:6B00F8D8
html-safe-nonceb2611e4205ff6c9d616cebb2d01f22e3aaf6f6e4388463e48b52972c73f6324d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0U0OjFDNkMzRTpEMkY0QTA6MTE3MzlENjo2QjAwRjhEOCIsInZpc2l0b3JfaWQiOiIxMzM4MDE4NzA5Nzc1NjQ0ODg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb559824407ba0afb80f57352c9ff850ea487b8acbbebde0ed128e0ff4ee8936f
hovercard-subject-tagissue:6326821041
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/65440/issue_layout
twitter:imagehttps://opengraph.githubassets.com/53b484ed1cad3148d1ac0ffc1dfb1a7af00fb2b471e36ee5194fea4cb62bf8ba/microsoft/TypeScript/issues/65440
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/53b484ed1cad3148d1ac0ffc1dfb1a7af00fb2b471e36ee5194fea4cb62bf8ba/microsoft/TypeScript/issues/65440
og:image:alt🔎 Search Terms TS5115, TS2589, "appear infinitely circular", "excessively deep and possibly infinite", variance, closure, 4820 🕗 Version & Regression Information This changed between versions 7.1.0...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRomainLanz
hostnamegithub.com
expected-hostnamegithub.com
Nonee208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187
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
release7dafd017fb7809a839c443dba08622af38e63c09
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/65440#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F65440
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%2F65440
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/65440
Reloadhttps://github.com/microsoft/TypeScript/issues/65440
Reloadhttps://github.com/microsoft/TypeScript/issues/65440
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)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/65440
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/65440
#65293https://github.com/microsoft/TypeScript/pull/65293
#65064https://github.com/microsoft/TypeScript/pull/65064
7.1 regression: bounded recursive types report TS5115 when inferred through a closurehttps://github.com/microsoft/TypeScript/issues/65440#top
#65293https://github.com/microsoft/TypeScript/pull/65293
#65064https://github.com/microsoft/TypeScript/pull/65064
https://github.com/ahejlsberg
https://github.com/jakebailey
Domain: check: Order DependenceErrors or types depend on the order of checker operations, e.g. LS / tsc discrepancieshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20check%3A%20Order%20Dependence%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
https://github.com/RomainLanz
Romain Lanz (RomainLanz)https://github.com/RomainLanz
on Nov 11, 2026https://github.com/microsoft/TypeScript/issues/65440#issue-6326821041
Order variance computation by associated type symbol typescript-go#4820https://github.com/microsoft/typescript-go/pull/4820
Restore idempotency to resolveObjectTypeMembers #64372https://github.com/microsoft/TypeScript/pull/64372
TS5115 in published Zod 4.5–4.6 types after #64372 #64605https://github.com/microsoft/TypeScript/issues/64605
Restore idempotency to resolveObjectTypeMembers #64372https://github.com/microsoft/TypeScript/pull/64372
https://github.com/RomainLanz/tsrs-type-issuehttps://github.com/RomainLanz/tsrs-type-issue
@adonisjs/http-transformershttps://www.npmjs.com/package/@adonisjs/http-transformers
microsoft/typescript-go#4820https://github.com/microsoft/typescript-go/pull/4820
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Nov 17, 2026https://github.com/microsoft/TypeScript/issues/65440#event-36429049917
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 Nov 17, 2026https://github.com/microsoft/TypeScript/issues/65440#event-36429053005
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 17, 2026https://github.com/microsoft/TypeScript/issues/65440#event-36429066382
Jake Bailey (jakebailey)https://github.com/jakebailey
Domain: check: Order DependenceErrors or types depend on the order of checker operations, e.g. LS / tsc discrepancieshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20check%3A%20Order%20Dependence%22
on Nov 18, 2026https://github.com/microsoft/TypeScript/issues/65440#event-36491885728
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/65440
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/65440
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Jake Bailey (jakebailey)https://github.com/jakebailey
Domain: check: Order DependenceErrors or types depend on the order of checker operations, e.g. LS / tsc discrepancieshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20check%3A%20Order%20Dependence%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
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.