René's URL Explorer Experiment


Title: Circular mapped property is treated as missing when selecting contextual type from intersections · Issue #64534 · microsoft/TypeScript · GitHub

Open Graph Title: Circular mapped property is treated as missing when selecting contextual type from intersections · Issue #64534 · microsoft/TypeScript

X Title: Circular mapped property is treated as missing when selecting contextual type from intersections · Issue #64534 · microsoft/TypeScript

Description: 🔎 Search Terms circular mapped property contextual type intersection index signature reverse mapped type isCircularMappedProperty 🕗 Version & Regression Information This changed in commit or PR #52095 ⏯ Playground Link No response 💻 Code...

Open Graph Description: 🔎 Search Terms circular mapped property contextual type intersection index signature reverse mapped type isCircularMappedProperty 🕗 Version & Regression Information This changed in commit or PR #52...

X Description: 🔎 Search Terms circular mapped property contextual type intersection index signature reverse mapped type isCircularMappedProperty 🕗 Version & Regression Information This changed in commit or PR...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Circular mapped property is treated as missing when selecting contextual type from intersections","articleBody":"### 🔎 Search Terms\n\ncircular mapped property contextual type intersection index signature reverse mapped type isCircularMappedProperty\n\n### 🕗 Version & Regression Information\n\n- This changed in commit or PR #52095\n\n### ⏯ Playground Link\n\n_No response_\n\n### 💻 Code\n\n```ts\ntype Func\u003cT> = () => T;\ntype Mapped\u003cT> = { [K in keyof T]: Func\u003cT[K]> };\n\ntype Indexed = {\n    [key: string]: () => 0 | 1;\n};\n\ndeclare function reproduce(options: number): void;\ndeclare function reproduce\u003cT>(options: Mapped\u003cT> & Indexed): T;\n\nexport const result = reproduce({\n    name: () => 0\n});\n```\n\n### 🙁 Actual behavior\n\nThe call is accepted.\n\nThe inferred declaration is:\n\n```ts\nexport declare const result: {\n    name: 0;\n};\n```\n\nDuring contextual typing, lookup of the `name` property through the reverse-mapped `Mapped\u003cT>` constituent reaches the circular mapped-property guard, so `getTypeOfConcretePropertyOfContextualType` does not produce a contextual property type from that constituent.\n\nThe intersection-specific contextual typing logic introduced in #52095 can then consider applicable index information from other constituents. In this example, the index signature from `Indexed` provides `() => 0 | 1` as the contextual type of `name`.\n\nThat contextual type preserves the returned `0` as a literal type, which allows reverse inference to infer:\n\n```ts\nT = {\n    name: 0;\n}\n```\n\nand the call succeeds.\n\nBefore #52095, the same code reports TS2769 because no index-signature contextual type is supplied in this situation. As a result, `() => 0` is inferred as `() => number`, which is not assignable to `() => 0 | 1`.\n\nThere appear to be two potentially separate questions here:\n\n1. Whether this reverse-mapped `name` property should reach the circular mapped-property guard at all.\n2. If the circularity guard does apply, whether the resulting lack of a concrete contextual property type should allow the intersection logic to fall back to an index signature in the same way as when no concrete property exists.\n\n### 🙂 Expected behavior\n\nI am not certain that the pre-#52095 TS2769 result is necessarily the desired behavior for this particular reproduction, since the currently inferred result is sound.\n\nWhat seems unclear is whether the interaction between circular mapped-property handling and the index-info fallback introduced in #52095 is intentional.\n\nIn particular, these situations currently become indistinguishable to the subsequent intersection contextual-typing logic:\n\n1. no concrete contextual property type is found because the property is absent\n2. no concrete contextual property type is produced because property resolution was suppressed by the circular mapped-property guard\n\nIf those cases are intentionally meant to permit the same index-info fallback, then the current behavior is expected.\n\nOtherwise, either:\n\n- the reverse-mapped property may be reaching the circularity guard when it should not, or\n- the reason that concrete property lookup produced no type may need to be preserved so that the intersection logic can distinguish circularity suppression from actual property absence.\n\nThe main question is therefore whether this interaction is intentional.\n\n### Additional information about the issue\n\nI found this while investigating my PR #64502, which deals with a different circular contextual-typing issue involving static properties.\n\nWhile tracing contextual property lookup and circularity handling, I noticed that this reproduction reaches a path where lookup of the reverse-mapped property is suppressed by the circular mapped-property check, after which the intersection logic introduced by #52095 uses an applicable index signature as the contextual type.\n\nI narrowed the observable behavior change down to #52095.\n\nTested revisions:\n\n- `6894ff7f38211589f0f41f8383727c57144857e1` (parent of #52095):\n  reports TS2769\n- `e6edc567a3946d203436265c5b525817fe2f708d` (#52095):\n  no error\n\n#38653 introduced the behavior where contextual typing does not attempt to resolve a mapped property when doing so would cause circular type resolution.\n\n#52095 later refactored contextual property lookup for intersections. When `getTypeOfConcretePropertyOfContextualType` does not produce a type for a constituent, the intersection logic may consider applicable index information unless a concrete property type is found elsewhere.\n\nI instrumented the current checker locally and confirmed that this reproduction reaches the path where contextual typing through the reverse-mapped property is suppressed by the circularity check and the index signature from the other intersection constituent is subsequently used as the contextual type.\n\nI also tested the current checker with that index-signature fallback temporarily suppressed for this case. With the fallback suppressed, the reproduction reports TS2769, matching the behavior from immediately before #52095.\n\nAt this point, I don't know whether the defect is specifically in the index-info fallback.\n\nIt may instead be that this reverse-mapped property should not be classified as circular at this stage.\n\nThe interesting interaction is that a lookup suppressed by the circularity guard and a lookup where no concrete property is available can both result in no concrete contextual property type being returned, while the subsequent intersection logic does not appear to distinguish why that happened.","author":{"url":"https://github.com/Fugu0141","@type":"Person","name":"Fugu0141"},"datePublished":"2026-09-29T16:21:05Z","url":"https://github.com/microsoft/TypeScript/issues/64534"}

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:a443df81-d0c0-041d-8af9-f5aa7173b244
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE388:10D9F8:B24A8B:ED1037:6B00EBE4
html-safe-noncebc4151f7e54f8d07292db7ca68d80ed9dc0ebbb471dad03530c984fa2f0b7a0f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzg4OjEwRDlGODpCMjRBOEI6RUQxMDM3OjZCMDBFQkU0IiwidmlzaXRvcl9pZCI6Ijk3NTc3NDc2ODUyOTczMDUzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac44c83a4cfbecf6aca02ef14682c9367bd231e956c364f7c29248bdb3ab972c86
hovercard-subject-tagissue:5633636599
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/64534/issue_layout
twitter:imagehttps://opengraph.githubassets.com/eb9311de8e299a88414340007ffde743662d9bbf124b24dbb92316e04a8d33d9/microsoft/TypeScript/issues/64534
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eb9311de8e299a88414340007ffde743662d9bbf124b24dbb92316e04a8d33d9/microsoft/TypeScript/issues/64534
og:image:alt🔎 Search Terms circular mapped property contextual type intersection index signature reverse mapped type isCircularMappedProperty 🕗 Version & Regression Information This changed in commit or PR #52...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameFugu0141
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/64534#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F64534
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%2F64534
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/64534
Reloadhttps://github.com/microsoft/TypeScript/issues/64534
Reloadhttps://github.com/microsoft/TypeScript/issues/64534
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)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/64534
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/64534
Circular mapped property is treated as missing when selecting contextual type from intersectionshttps://github.com/microsoft/TypeScript/issues/64534#top
UnactionableThere isn't something we can do with this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Unactionable%22
https://github.com/Fugu0141
ふぐ/Fugu (Fugu0141)https://github.com/Fugu0141
on Sep 29, 2026https://github.com/microsoft/TypeScript/issues/64534#issue-5633636599
Fixed an issue with contextual type for intersection properties (take 2) #52095https://github.com/microsoft/TypeScript/pull/52095
#52095https://github.com/microsoft/TypeScript/pull/52095
#52095https://github.com/microsoft/TypeScript/pull/52095
#52095https://github.com/microsoft/TypeScript/pull/52095
#52095https://github.com/microsoft/TypeScript/pull/52095
#64502https://github.com/microsoft/TypeScript/pull/64502
#52095https://github.com/microsoft/TypeScript/pull/52095
#52095https://github.com/microsoft/TypeScript/pull/52095
Fixed an issue with contextual type for intersection properties (take 2) #52095https://github.com/microsoft/TypeScript/pull/52095
Fixed an issue with contextual type for intersection properties (take 2) #52095https://github.com/microsoft/TypeScript/pull/52095
#38653https://github.com/microsoft/TypeScript/pull/38653
#52095https://github.com/microsoft/TypeScript/pull/52095
#52095https://github.com/microsoft/TypeScript/pull/52095
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 29, 2026https://github.com/microsoft/TypeScript/issues/64534#issuecomment-5895377674
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs More InfoThe issue still hasn't been fully clarifiedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20More%20Info%22
on Sep 29, 2026https://github.com/microsoft/TypeScript/issues/64534#event-32100801283
https://github.com/Andarist
Mateusz Burzyński (Andarist)https://github.com/Andarist
on Sep 29, 2026https://github.com/microsoft/TypeScript/issues/64534#issuecomment-5896176125
https://github.com/Fugu0141
ふぐ/Fugu (Fugu0141)https://github.com/Fugu0141
on Sep 29, 2026https://github.com/microsoft/TypeScript/issues/64534#issuecomment-5901290050
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
No contextual types from circular mapped type properties #38653https://github.com/microsoft/TypeScript/pull/38653
Fixed an issue with contextual type for intersection properties (take 2) #52095https://github.com/microsoft/TypeScript/pull/52095
#52095https://github.com/microsoft/TypeScript/pull/52095
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
UnactionableThere isn't something we can do with this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Unactionable%22
Needs More InfoThe issue still hasn't been fully clarifiedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20More%20Info%22
on Oct 6, 2026https://github.com/microsoft/TypeScript/issues/64534#event-32613321058
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Oct 6, 2026https://github.com/microsoft/TypeScript/issues/64534#issuecomment-6019685682
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
not plannedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Oct 6, 2026https://github.com/microsoft/TypeScript/issues/64534#event-32613557301
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/64534
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/64534
UnactionableThere isn't something we can do with this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Unactionable%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.