René's URL Explorer Experiment


Title: Type guard should infer the type of parent object when applied on a property · Issue #42384 · microsoft/TypeScript · GitHub

Open Graph Title: Type guard should infer the type of parent object when applied on a property · Issue #42384 · microsoft/TypeScript

X Title: Type guard should infer the type of parent object when applied on a property · Issue #42384 · microsoft/TypeScript

Description: Suggestion 🔍 Search Terms Type guard, parent object, infer, inference ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript code This wouldn't change the runtime ...

Open Graph Description: Suggestion 🔍 Search Terms Type guard, parent object, infer, inference ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScrip...

X Description: Suggestion 🔍 Search Terms Type guard, parent object, infer, inference ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaS...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type guard should infer the type of parent object when applied on a property","articleBody":"# Suggestion\r\n\r\n## 🔍 Search Terms\r\n\r\nType guard, parent object, infer, inference\r\n\r\n## ✅ Viability Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n\r\n* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [x] This could be implemented without emitting different JS based on the types of the expressions\r\n* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\r\n* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n\r\n## ⭐ Suggestion\r\n\r\nTypescript should be able to infer the type of an object, if a type guard was checked on a property of the said object. Currently, Typescript does correctly infer the type of the property, but not its parent object.\r\n\r\n## 📃 Motivating Example\r\n\r\nThe following example is very common in data oriented design.\r\n\r\n```typescript\r\ninterface Type1 { list: string[] }\r\n\r\ninterface Type2 { list: { [key: string]: string } }\r\n\r\ndeclare const obj: Type1 | Type2;\r\n\r\nif(Array.isArray(obj.list)) {\r\n    const list: string[] = obj.list; // WORKS\r\n    const map: { [key: string]: string } = obj.list; // ERROR, as expected\r\n    const objCasted: Type1 = obj; // ERROR, unexpectedly\r\n} else {\r\n    const map: { [key: string]: string } = obj.list; // WORKS\r\n    const list: string[] = obj.list; // ERROR, as expected\r\n    const objCasted: Type2 = obj; // ERROR, unexpectedly\r\n}\r\n```\r\n\r\nThe following example works and that is good because it is an equally common case in this type of design. \r\n\r\n```typescript\r\ninterface Type3 { type: 'type3', data: boolean }\r\n\r\ninterface Type4 { type: 'type4', data: string }\r\n\r\ndeclare const obj2: Type3 | Type4;\r\n\r\nif(obj2.type === 'type3') {\r\n    const objCasted: Type3 = obj2; // WORKS\r\n} else {\r\n    const objCasted: Type4 = obj2; // WORKS\r\n}\r\n```\r\n\r\nSo I believe the type guards should work the same way. As far as I see, this does not cause any inconsistency in the language or the type system. It is an improvement without any downsides.\r\n\r\n## 💻 Use Cases\r\n\r\nSee the [full example](https://www.typescriptlang.org/play?ts=5.4.0-dev.20240107#code/FASwdgLgpgTgZgQwMZQAQBUCeAHKBGVAb1QBsQBnCALlUpnAHMBtAXVQF9hRJZEUMcUAExFSFaqKYBrKJhp1GLeRHpgGHDlwAmUJCQQw0SAPZhKqYwCMAVjSy4CAHwG4hAbi4g4ACgCCMGARMADoKf0DMbytrYLJKAEpUAF4U1BUAVyhEwmBUPNQTMwgxSmVVZjYkixtY8TdUAHoG1AB1AHkAJQBpAGVc-P68ptQAAQhyAFooAA9cJAgpgOMYQYLTcwBbBGwaYmlZMsVDtQ0q6NrKeuGAUQ6OzoAaVARyVBm56C1V1cLzaIBhF6fOyCAhnGxXZq3e4dJ7pMDvXSfEiYYDsN4kchoHL5NZFVBbHaSGRyWgqI5k8qnaoxOIQSGtTq9Li44ZjSaI+aLGDLH7rYp044VZI0i70xpQu6PZ6vTmfFn5X7FAFAqBaEGuEXRBnQ6XwuVqlForieHjwZBoexQADMoggghoAHJ7bhrY6nloEBAEDRLMZjCQoAgwJpuNBzfwrQAWO0O1DOwRR92oT3eoWhnR6AxGfk0oQam2oZzRjygHzRITBF1oFJVBOux3ZPn4lWUNUF23g6zuCWM7p9dFQTHY5t-GyAtvqlxQGNdnvDdr942m8N8S2CACssdwvv9geDofAq4t04AbNuoOnOMBM-pDHix9ZrQWt8XBKfS15vNXjHAadaq0EZJUkdP0AyDMBGyIUdlXHVUpytLcu2tBkWmWKRXnIcB+CjYIAE40QxLFoNxJUaQnYEzy1GwUN7NCYAw2hsLQXCCM4IA).","author":{"url":"https://github.com/gkurt","@type":"Person","name":"gkurt"},"datePublished":"2021-01-17T16:12:45Z","url":"https://github.com/microsoft/TypeScript/issues/42384"}

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:aac1c553-6746-d884-2b41-230c9b717b95
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idED64:3F8AB1:C261BC:FAAA24:6B00EB89
html-safe-noncebaf34d943abb3a3b1d0163cd0a63e01cf2e7e71a8696a2e4a90298fc6923322c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDY0OjNGOEFCMTpDMjYxQkM6RkFBQTI0OjZCMDBFQjg5IiwidmlzaXRvcl9pZCI6IjY0Mjg1OTg2NjY5NDgzMDc4NDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9d8c19810beb86b539e0aea66c95ae623bbcbfab4a4d228a6b954757f2cb7516
hovercard-subject-tagissue:787738672
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/42384/issue_layout
twitter:imagehttps://opengraph.githubassets.com/09171478596fa499d49c5a694c6d94b87951748fb718b1bc941b7a1196f8c6c4/microsoft/TypeScript/issues/42384
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/09171478596fa499d49c5a694c6d94b87951748fb718b1bc941b7a1196f8c6c4/microsoft/TypeScript/issues/42384
og:image:altSuggestion 🔍 Search Terms Type guard, parent object, infer, inference ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScrip...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegkurt
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-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/42384#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F42384
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%2F42384
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/42384
Reloadhttps://github.com/microsoft/TypeScript/issues/42384
Reloadhttps://github.com/microsoft/TypeScript/issues/42384
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/42384
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/42384
Type guard should infer the type of parent object when applied on a propertyhttps://github.com/microsoft/TypeScript/issues/42384#top
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/gkurt
Gokhan Kurt (gkurt)https://github.com/gkurt
on Jan 17, 2021https://github.com/microsoft/TypeScript/issues/42384#issue-787738672
TypeScript's Design Goalshttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
full examplehttps://www.typescriptlang.org/play?ts=5.4.0-dev.20240107#code/FASwdgLgpgTgZgQwMZQAQBUCeAHKBGVAb1QBsQBnCALlUpnAHMBtAXVQF9hRJZEUMcUAExFSFaqKYBrKJhp1GLeRHpgGHDlwAmUJCQQw0SAPZhKqYwCMAVjSy4CAHwG4hAbi4g4ACgCCMGARMADoKf0DMbytrYLJKAEpUAF4U1BUAVyhEwmBUPNQTMwgxSmVVZjYkixtY8TdUAHoG1AB1AHkAJQBpAGVc-P68ptQAAQhyAFooAA9cJAgpgOMYQYLTcwBbBGwaYmlZMsVDtQ0q6NrKeuGAUQ6OzoAaVARyVBm56C1V1cLzaIBhF6fOyCAhnGxXZq3e4dJ7pMDvXSfEiYYDsN4kchoHL5NZFVBbHaSGRyWgqI5k8qnaoxOIQSGtTq9Li44ZjSaI+aLGDLH7rYp044VZI0i70xpQu6PZ6vTmfFn5X7FAFAqBaEGuEXRBnQ6XwuVqlForieHjwZBoexQADMoggghoAHJ7bhrY6nloEBAEDRLMZjCQoAgwJpuNBzfwrQAWO0O1DOwRR92oT3eoWhnR6AxGfk0oQam2oZzRjygHzRITBF1oFJVBOux3ZPn4lWUNUF23g6zuCWM7p9dFQTHY5t-GyAtvqlxQGNdnvDdr942m8N8S2CACssdwvv9geDofAq4t04AbNuoOnOMBM-pDHix9ZrQWt8XBKfS15vNXjHAadaq0EZJUkdP0AyDMBGyIUdlXHVUpytLcu2tBkWmWKRXnIcB+CjYIAE40QxLFoNxJUaQnYEzy1GwUN7NCYAw2hsLQXCCM4IA
https://github.com/MartinJohns
Martin Johns (MartinJohns)https://github.com/MartinJohns
on Jan 17, 2021https://github.com/microsoft/TypeScript/issues/42384#issuecomment-761853522
Quoting @jack-williams:https://github.com/microsoft/TypeScript/issues/31755#issuecomment-498669080
commenthttps://github.com/microsoft/TypeScript/issues/30506#issuecomment-474802840
https://github.com/gkurt
Gokhan Kurt (gkurt)https://github.com/gkurt
on Jan 18, 2021https://github.com/microsoft/TypeScript/issues/42384#issuecomment-762120091
Martin Johns (@MartinJohns)https://github.com/MartinJohns
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Jan 19, 2021https://github.com/microsoft/TypeScript/issues/42384#event-4224096910
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jan 19, 2021https://github.com/microsoft/TypeScript/issues/42384#issuecomment-763048323
https://github.com/JoshuaWise
Joshua Wise (JoshuaWise)https://github.com/JoshuaWise
on Mar 26, 2021https://github.com/microsoft/TypeScript/issues/42384#issuecomment-808418509
SuperStructhttps://www.npmjs.com/package/superstruct
Koahttps://www.npmjs.com/package/koa
https://github.com/bartenra
bartenrahttps://github.com/bartenra
on Jul 2, 2021https://github.com/microsoft/TypeScript/issues/42384#issuecomment-872906445
https://github.com/dospunk
Connor Dooley (dospunk)https://github.com/dospunk
on Jan 27, 2022https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1023618384
https://github.com/ddejohn
Devon DeJohn (ddejohn)https://github.com/ddejohn
on Feb 11, 2022https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1036670810
playgroundhttps://www.typescriptlang.org/play#code/C4TwDgpgBAKuEEYoF4oG8BQUoGED2AJhAFxQBEAgmQNxZQByEAzsBAQAoBOeknwAls1KZs2AMp4AthGAALfgDsA5gHkFAGxBxICABIBDJqTL6ARgGMadAL61bGDKEix4AJhTo6+IsYBCV7EYWNi4eCD5BI09RKAlpFTlwsWBOAFdzYFTOCDVNbQhXAyiRGKgAUQAPc2YmfgA3CE0g1g5uXlBjeShE7IDRe2x7e0d4WA98pAAfF0hXWgwAM1SFDP48BSgwzn1WNQmACmBSCYBKUjq8fgJoqHN1pjx1CAA6dTwlQ+fmkLbwgWZnnEZPJlLktPA9IYTnYHEsVgJ1pteDscgp8q5Dsc3GcoBcrjc7goHk9Xu99nRsMAvswWqF2pFAVIcj1kmkMllUXk3EVnpVqkxag0mjSfltQHRoRhrA4nsBNqYAFbHeZMADu-GA5lkUH2eEVz28EBOBMM0EoZGIFKR4RRewhusVkpipmy+gA1rRsOZTeR-JaYltbWi3A6FU7RC6IO6YUA
https://github.com/bartenra
bartenrahttps://github.com/bartenra
on Mar 30, 2022https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1083119502
Playgroundhttps://www.typescriptlang.org/play#code/GYVwdgxgLglg9mABAQwM6oKYCcoDEYYA2AJgDz5HGIYAeUGYxqiqUWMYA5gDSIAq1OgyaIA3ogDawAiUQdEFEgF0A-AC5+UmcSWIAvgD4AFAChEiOACMAVhr7cziaZQ2LiJgJQar1ucwEAZGKSzrLybkoaAHIIUSCEhMiWhBikfFqUSgZ6Yo4wwIhGAIQ+GcoeTsiEmADcjlgYUCBYSGwgGHV6JiZQAJ4ADhiIAMqEcFCIALzBMMTqLGwcnPrdoJCwCIhgGBhMAJLERqhjUBrisxqs7Fz6FaImXSZr0PCtGKxHJxqj43fd5vlCsdxgA6WZ-czmYFQMHEGrmAD0CIW12WAB9EOBiBhpNt3I5EcjtrtUAdPr9zABRABK1IA8tTHI8AQUjGhMDg3OSoLwAOSzXkeCGQ6Gw+GIJEopb-SHE-aHaEecWSgDqDIA0sMmQ8gA
https://github.com/Fryuni
Luiz Ferraz (Fryuni)https://github.com/Fryuni
on Sep 6, 2022https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1238758843
Example on the playground.https://www.typescriptlang.org/play?ts=4.9.0-dev.20220905&ssl=10&ssc=8&pln=6&pc=1#code/C4TwDgpgBAYg9nKBeKBvAUFLUBGBDAJwC4oBnYAgSwDsBzAGk23wC8B+E8quxgXwG506UJCgBZPAGsIASWAAFAnDB5aeYBAA8AFXpQA0lAgAPDdQAmpKNJBwAZlG0A+ZFCZYAPlAAUAeQC2lMA6evouAGRQ8oTAlHgANpoAShAAxnAE5pr6etQQAG4QBE5OAJTuUF5+gcG6BhFoFdhQANr6MlA0BgC6ALQcUABycNSDAK7x8Xg48VrabTLdThW8pYLC4NDwcADqQQAWAEJ4LK7bUJEYzawkw6MTUzNa2y0A5KyvS3zrdmPUqbERlBgFIIKRtsMCP4Et47CRtqVGs1KA5YQA6VjIJAoP7mCB2GgQcyIq7NbAECDAMYEaiCZq8ITNAD0TMc+0oVnMcDB1FewCgAHcMpIKiDpOCEHtgEcTrC1ugGehfv9AdRgaCJXAAIIWRTKVTqCCwkgSaRyPUqNQaTTbPTvE6vMpI7Aonx2DEnLE4iz4wnE51kqAUqk0unYRXM1nadlWIUESSxg7A-bQPIC4GbUUa7ZSmUsOWCRXKgGUIFisE5g7HfMAfXhkqrJxJivS1HIUDsCFcqF4UDwVm263Lmsh0PisIQ8uH2x15gtBo0E7gayAA
https://github.com/jcalz
Joe Calzaretta (jcalz)https://github.com/jcalz
on Oct 13, 2022https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1276949492
#50891https://github.com/microsoft/TypeScript/issues/50891
in-narrowing for unlisted propertieshttps://devblogs.microsoft.com/typescript/announcing-typescript-4-9-beta/#in-narrowing
https://github.com/medihack
Kai Schlamp (medihack)https://github.com/medihack
on Oct 20, 2022https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1286159167
Playgroundhttps://www.typescriptlang.org/play?ts=4.8.4&ssl=21&ssc=1&pln=1&pc=1#code/C4TwDgpgBAKuEEYoF4oG8BQVtQHYEMBbCALigCI5IFyscwAnAe0geAEsIBnMzHfqIxYQ2IMuXwAbMAAt8tfgF8MyjKEix4AJhTo62AsXFUIWhfWasO3XvoFCrYigCMIweXeWrJbqE2cAVmQmSAA+mpA6qGiKUPhccbggGBjsAGZQABT+AQB0DiLWXPmWhSAoyKjkru7kAJR6-Dm5htCVVSHkUHYA9D3YAHpDA1DAEJKSCcRQ7MBQAMZMAK6SACZQrhGIfgxbWgCEAPwqGEA
https://github.com/jcalz
Joe Calzaretta (jcalz)https://github.com/jcalz
on Oct 25, 2022https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1290811436
#18758https://github.com/microsoft/TypeScript/issues/18758
https://github.com/nmattia
Nicolas Mattia (nmattia)https://github.com/nmattia
on Feb 3, 2023https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1415859638
Providedhttps://www.typescriptlang.org/play?ts=5.0.0-dev.20230203#code/GYVwdgxgLglg9mABMAFASgFyIAyIN4CwAUMYogDYCmUiAHogLyICM2A3KcnAE4pttp8nMjGCIU9BlJxpCRMgsTdqIbklod5CgL6ddRfcVCRYCRAHN0WPMDhws2bUJJaqNSflv2WjzWVu8-IJyiqLitAB0XozS2LLCCspQqup+OnrE2kA
https://github.com/Fryuni
Luiz Ferraz (Fryuni)https://github.com/Fryuni
on Feb 3, 2023https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1415924774
Nicolas Mattia (@nmattia)https://github.com/nmattia
thishttps://www.typescriptlang.org/play?ts=5.0.0-dev.20230203#code/GYVwdgxgLglg9mABMAFASgFyIAyIN4CwAUIogDYCmUiAHogLyICM2A3MacHAE4qutp8HUohjBEKOvWk40hEiNLcqIbkhrsFpAL7DdRfcVCRYCRAHMKYCtwCGUCuix4ucLNm2IAPvldYWnvJKKmq+cG7MHpqGRMbQ8EjmTmERHkIKlNRSFlY29o5ompw8fALpimISNAB0rgwy2HLCispQqupFIvo6xNpAA
thishttps://www.typescriptlang.org/play?ts=5.0.0-dev.20230203#code/GYVwdgxgLglg9mABMAFASgFyIAyIN4CwAUIogDYCmUiAHogLyICM2A3MacHAE4qutp8HUohjBEKOvWk40hEiNLcqIbkhrsFpAL7DdRfcVCRYCRAHMKYCtwCGUCuix4ucLLgA+zbNqELlUKpILnBu3tqahkTG0PBI5k74ru6+8qSU1FIWVjb2jmianDx8An6KYhI0AHSuDDLYcsKKAUG0hSL6OsTaQA
#42384 (comment)https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1238758843
https://github.com/gordonmleigh
Gordon Leigh (gordonmleigh)https://github.com/gordonmleigh
on Feb 22, 2023https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1440615593
https://github.com/jtbandes
Jacob Bandes-Storch (jtbandes)https://github.com/jtbandes
on Nov 9, 2023https://github.com/microsoft/TypeScript/issues/42384#issuecomment-1803019311
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/DawidKopys
Dawid Kopys (DawidKopys)https://github.com/DawidKopys
on Jun 13, 2024https://github.com/microsoft/TypeScript/issues/42384#issuecomment-2165733801
herehttps://www.typescriptlang.org/play/?ts=5.4.5#code/C4TwDgpgBAsiCqA7Alge0VAvFA3gKCkKgEMAnUgLigGdhTlEBzAbQF0AaAo0SKgcnQQ+eAL5QAPri6EylKIgCuAWwBGEUm05EoPCP2AB3VMJF4zAMwWIAxsDQYAKhFoAKJQqpwk9gJRTtAPQBUAAW6hDs8rKoBgyMUEakANbUFNJQyOZQbgoAdLpYmNgCiEJ++NqBwbLMAAysGdRR5DEQACY6qFB8tPRMfCRNEAAekLbt6druuTX1+agAMq2kAMLE1BAuPuliEAA2G-6VhEEk5HUNyE2I0Qbtnd2KquoD61AjY8ATx4TTs6zzACio0EiDsxD2LgATNttKZ0qcbi1YkwoG1UM5EHxgAlUMkoGo9jE0tpzHjstZ0LR3nsoKgsn9yOVJkRMtlpgUisVBHxmT9Kqc+PsBtQQqgFHsOmpmqRWh1gF0enQ4gMwqQICzjqdcjqCQocXcoIwIDiHABld4tOQAIgACrLIKRQN0FUs7qt1kI0RjrqgcSMrjj0DpwNAlX14pInmpSHxrZrKvt5m71GsNlsE7sDtAKvyiILhTQxRKpdAkbK7vLFdGXqFwgmqlAdbk9QboMbTRb1LKbfbUI7ndjUMCwKDwXsBujnPI-e9hoG6RgCuG4hJ5MoY3GG0QkwqR2PkBDobCfqY4aI8EA
https://github.com/jcready
James Wyatt Cready-Pyle (jcready)https://github.com/jcready
on Jul 5, 2024https://github.com/microsoft/TypeScript/issues/42384#issuecomment-2211010948
https://github.com/MichalMarsalek
Michal Maršálek (MichalMarsalek)https://github.com/MichalMarsalek
on Aug 26, 2024https://github.com/microsoft/TypeScript/issues/42384#issuecomment-2311163777
typeguard factoryhttps://www.typescriptlang.org/play/?ts=5.5.4#code/JYOwLgpgTgZghgYwgAgAoHsA2BPA5ukZAbwChlkxsAHCALmQCIMd8QGBuM5BddKAE1BxIAZ3ogArgFsARtADaAXSVLOAXxIlQkWIhQAZUBADKYKKFzEulGvQaGQJsxY5cefQSGEQxySbIVlRXVNAHpQ5AA6aOQpPhRcCHQpCDNsCmofTRsUAHEklLTkAF40LDwCZAAfZAcncxBcbMzkADEIYQkoCAAeABVkCAAPSBB+EWR85NSodNKpwtmAPhKrchy7ds7u13JE6bT6Ps5yKih0GigwYB96IjUQkhgJEARryuARLbAu3r6W4ajcaTAozbDyBg5BiKJYACg2yH+NAAlGtyMhuj8oIRnq93iBYUN6N9fsj6ENkJ82h0sb0AKIjKCIMA9BZggA0xARSIgaiWK1I6KFGNSXUIQ0i+0W2EiORKxVKOS45A0GhI-AgCEwcG63AIIjAyBgNN+xJN3U4WhgyFhnxJ3VhTHKrAYyNhxu2EGRyMF6I9tMloLSkXcAiEomQ4T80jkUBUQRIaiAA
#18758https://github.com/microsoft/TypeScript/issues/18758
https://github.com/AlbertMarashi
Albert Marashi (AlbertMarashi)https://github.com/AlbertMarashi
on Sep 4, 2024https://github.com/microsoft/TypeScript/issues/42384#issuecomment-2327709232
https://github.com/Rudxain
Ricardo Fernández Serrata (Rudxain)https://github.com/Rudxain
on Nov 14, 2024https://github.com/microsoft/TypeScript/issues/42384#issuecomment-2477274707
Another reprohttps://www.typescriptlang.org/play/?noUncheckedIndexedAccess=true&target=10&jsx=0&strictBuiltinIteratorReturn=true&noPropertyAccessFromIndexSignature=true#code/CYUwxgNghgTiAEYD2A7AzgF3lAXPFArgLYBGIMA2gLrwA+8JAlgOaMobUBQny6WFUAAwAabAEYaAXmzdGAM3gAKDAE8ADiCQKh8SdIDkhUuX0BKeAG9OASF6Z4AfTxGyMOvAIpQctiGC7xTgBfTnklVQ0tcV0DFxNzK1tUeyd8YlcAoWDZBUUoADoQADdyFUUAD10APngIzQVKvXhDdPiEmzssVLi3aSyQgHoB+AB3JBgAa1gkT2BQ3ILi0orq2vV6+EbY1pgzdqS+eAERcSkZA5TBZx33WZAfFD9MwQ7krrFr4zd6O4envrE2SAA
https://github.com/eliasm307
eliasm307 (eliasm307)https://github.com/eliasm307
on Dec 24, 2024https://github.com/microsoft/TypeScript/issues/42384#issuecomment-2561282538
https://www.typescriptlang.org/play/?#code/MYewdgzgLgBCBGArAXDA3gMxCV0BOAlmAOYwA+MYArgDY0C+MAvOljjAEQf0DcAUHwAmAU2A0AhnmEwMVMMCgFwMgBSTiqTNlxRCJegEpUANxAFBAghhUJEAOjYH0fGK9W2nAek8wAKgE0ABQBRGGCAJXCAeXDUEGNhPHE6OCRRWCgATwAHaTAQWDBJPBAAd2FBGCgQGAALcQSYbJLcvCyYcQhKcABaajpxeBphATdVLXZbB2xDGG8YKIBpOLSFJpbE9qzcrqK8EvLK0trhMBgqCAqYIkECY3MqZJpMvnogAhttps://www.typescriptlang.org/play/#code/MYewdgzgLgBCBGArAXDA3gMxCV0BOAlmAOYwA+MYArgDY0C+MAvOljjAEQf0DcAUHwAmAU2A0AhnmEwMVMMCgFwMgBSTiqTNlxRCJegEpUANxAFBAghhUJEAOjYH0fGK9W2nAek8wAKgE0ABQBRGGCAJXCAeXDUEGNhPHE6OCRRWCgATwAHaTAQWDBJPBAAd2FBGCgQGAALcQSYbJLcvCyYcQhKcABaajpxeBphATdVLXZbB2xDGG8YKIBpOLSFJpbE9qzcrqK8EvLK0trhMBgqCAqYIkECY3MqZJpMvnogA
Simon Schick (SimonSimCity)https://github.com/SimonSimCity
Type narrowing not applied for nested types when passing to function #62525https://github.com/microsoft/TypeScript/issues/62525
on Oct 2, 2025https://github.com/microsoft/TypeScript/issues/42384#event-20055250076
https://github.com/lith-x
Aaron (lith-x)https://github.com/lith-x
on Apr 24, 2026https://github.com/microsoft/TypeScript/issues/42384#issuecomment-4309351634
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/42384
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/42384
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%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.