| route-pattern | /:user_id/:repository/pull/:id/commits/:range(.:format) |
| route-controller | pull_requests |
| route-action | commits |
| fetch-nonce | v2:b8f74452-0067-74d0-1ae0-22073d115539 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9AFC:301411:205E67B:2BE35DB:6A655891 |
| html-safe-nonce | b9b108dcb3984080234d740f413b236ab25822615fbdc24fa0fda53ae015cb7b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUZDOjMwMTQxMToyMDVFNjdCOjJCRTM1REI6NkE2NTU4OTEiLCJ2aXNpdG9yX2lkIjoiNzQxMDIyMTc2OTI2NTg3MDI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 35ea8179a66e0170cfa4bc0c2d3a7b107b5ce9435f3e3e669dffca63a3890737 |
| hovercard-subject-tag | pull_request:2374737243 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/commits |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
| twitter:image | https://avatars.githubusercontent.com/u/19519347?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/19519347?s=400&v=4 |
| og:image:alt | Fixes #33014.
Fixes #33912.
This PR brings back conditional and indexed access return type narrowing from #56941, but with a few updates.
The main motivation behind those updates is described in ht... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 309153364422b3c499922d1a2a6404910a58ed8e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fpull%2F61359%2Fcommits%2Fc872eb853c6a895a3be257f22f75a00b0a13ee34 |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub Copilot appDirect agents from issue to merge | https://github.com/features/ai/github-app |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| Code QualityEnforce quality at merge | https://github.com/features/code-quality |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| View all resources | https://github.com/resources |
| GitHub SponsorsFund open source developers | https://github.com/open-source/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/open-source/accelerator |
| GitHub Stars | https://stars.github.com |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fpull%2F61359%2Fcommits%2Fc872eb853c6a895a3be257f22f75a00b0a13ee34 |
|
Sign up
| https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=microsoft%2FTypeScript |
| Reload | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
| Reload | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
| Reload | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
| Please reload this page | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
|
microsoft
| https://github.com/microsoft |
| TypeScript | https://github.com/microsoft/TypeScript |
|
Notifications
| https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript |
|
Fork
13.6k
| https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript |
|
Star
110k
| https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript |
|
Code
| https://github.com/microsoft/TypeScript |
|
Issues
5k+
| https://github.com/microsoft/TypeScript/issues |
|
Pull requests
20
| https://github.com/microsoft/TypeScript/pulls |
|
Actions
| https://github.com/microsoft/TypeScript/actions |
|
Projects
| https://github.com/microsoft/TypeScript/projects |
|
Models
| https://github.com/microsoft/TypeScript/models |
|
Wiki
| https://github.com/microsoft/TypeScript/wiki |
|
Security and quality
0
| https://github.com/microsoft/TypeScript/security |
|
Insights
| https://github.com/microsoft/TypeScript/pulse |
|
Code
| https://github.com/microsoft/TypeScript |
|
Issues
| https://github.com/microsoft/TypeScript/issues |
|
Pull requests
| https://github.com/microsoft/TypeScript/pulls |
|
Actions
| https://github.com/microsoft/TypeScript/actions |
|
Projects
| https://github.com/microsoft/TypeScript/projects |
|
Models
| https://github.com/microsoft/TypeScript/models |
|
Wiki
| https://github.com/microsoft/TypeScript/wiki |
|
Security and quality
| https://github.com/microsoft/TypeScript/security |
|
Insights
| https://github.com/microsoft/TypeScript/pulse |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Fmicrosoft%2FTypeScript%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript%2Fissues%2Fnew%2Fchoose |
| gabritto | https://github.com/gabritto |
| main | https://github.com/microsoft/TypeScript/tree/main |
| gabritto/fixedcond | https://github.com/microsoft/TypeScript/tree/gabritto/fixedcond |
|
Conversation
16
| https://github.com/microsoft/TypeScript/pull/61359 |
|
Commits
12
| https://github.com/microsoft/TypeScript/pull/61359/commits |
|
Checks
0
| https://github.com/microsoft/TypeScript/pull/61359/checks |
|
Files changed
| https://github.com/microsoft/TypeScript/pull/61359/files |
| Please reload this page | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
|
Bring back return type narrowing + fixes
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#top |
|
Show all changes
12 commits
| https://github.com/microsoft/TypeScript/pull/61359/files |
|
aa38e34
Revert "Revert return type narrowing (#61136)"
gabritto Mar 5, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/aa38e34c18a5a1ed0b5a661abcac7ca3a5061314 |
|
073d868
add restriction on narrowable type constraint
gabritto Feb 1, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/073d868abed1a1800e14bc0e7ebc42585ee94f76 |
|
17ed356
relax restriction on extends type of narrowable conditional type
gabritto Feb 1, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/17ed356c580798f88470c359892f59747dba147f |
|
fdb6bea
WIP: detect embedded references to a narrowable type parameter
gabritto Feb 1, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/fdb6beabee44085a9d61f1777d4eaf8917fb9c9a |
|
1849292
Detect and construct narrowable references for embedded type parameters
gabritto Feb 28, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/18492922064d6115f891d1e13a61d24d3cdca9b8 |
|
009d152
validate optional param/property
gabritto Mar 4, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/009d1524e18d691c8620be9529fa93a1fb967cbb |
|
5cb7e90
format
gabritto Mar 5, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/5cb7e902bc1bfab7249a79da5d42f3b174778fe9 |
|
3c5327e
rework non-primitive restriction to be based on conditional type bran…
gabritto Mar 5, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/3c5327e4796874c3e94a4701b0ec72352bc57771 |
|
7464af0
update tests
gabritto Mar 5, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/7464af0f099eba2aaa6e3073e76f25874ad7b919 |
|
c96e01e
bring back conditional expression test
gabritto Mar 5, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/c96e01e4fe582be7da354bf00752a08287fcedbc |
|
c872eb8
Also support classes. TODO: support parameter properties
gabritto Mar 21, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
|
2084fa0
fix baselines
gabritto Mar 21, 2025
| https://github.com/microsoft/TypeScript/pull/61359/commits/2084fa0a24c68ca14b009661eb2c3b9b2e606f40 |
|
Clear filters
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
| Please reload this page | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
| Please reload this page | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
|
checker.ts
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8 |
|
dependentReturnType11.errors.txt
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-a5ee2347507d3d9bf58bd52c571c4cec9231638d4d3dbea4b2308e6f79f17884 |
|
dependentReturnType11.ts
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-aea804e6c093940044bce81458b5407920d4cc070b6b123e4c98014171f46966 |
|
Prev
| https://github.com/microsoft/TypeScript/pull/61359/commits/c96e01e4fe582be7da354bf00752a08287fcedbc |
|
Next
| https://github.com/microsoft/TypeScript/pull/61359/commits/2084fa0a24c68ca14b009661eb2c3b9b2e606f40 |
| Please reload this page | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34 |
|
| https://github.com/gabritto |
| gabritto | https://github.com/microsoft/TypeScript/commits?author=gabritto |
| src/compiler/checker.ts | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8 |
|
View file
| https://github.com/microsoft/TypeScript/blob/c872eb853c6a895a3be257f22f75a00b0a13ee34/src/compiler/checker.ts |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/microsoft/TypeScript/pull/61359/commits/{{ revealButtonHref }} |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8 |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8 |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8 |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8 |
| tests/baselines/reference/dependentReturnType11.errors.txt | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-a5ee2347507d3d9bf58bd52c571c4cec9231638d4d3dbea4b2308e6f79f17884 |
|
View file
| https://github.com/microsoft/TypeScript/blob/c872eb853c6a895a3be257f22f75a00b0a13ee34/tests/baselines/reference/dependentReturnType11.errors.txt |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/microsoft/TypeScript/pull/61359/commits/{{ revealButtonHref }} |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-a5ee2347507d3d9bf58bd52c571c4cec9231638d4d3dbea4b2308e6f79f17884 |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-a5ee2347507d3d9bf58bd52c571c4cec9231638d4d3dbea4b2308e6f79f17884 |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-a5ee2347507d3d9bf58bd52c571c4cec9231638d4d3dbea4b2308e6f79f17884 |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-a5ee2347507d3d9bf58bd52c571c4cec9231638d4d3dbea4b2308e6f79f17884 |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-a5ee2347507d3d9bf58bd52c571c4cec9231638d4d3dbea4b2308e6f79f17884 |
| tests/cases/compiler/dependentReturnType11.ts | https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-aea804e6c093940044bce81458b5407920d4cc070b6b123e4c98014171f46966 |
|
View file
| https://github.com/microsoft/TypeScript/blob/c872eb853c6a895a3be257f22f75a00b0a13ee34/tests/cases/compiler/dependentReturnType11.ts |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/microsoft/TypeScript/pull/61359/commits/{{ revealButtonHref }} |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-aea804e6c093940044bce81458b5407920d4cc070b6b123e4c98014171f46966 |
|
| https://github.com/microsoft/TypeScript/pull/61359/commits/c872eb853c6a895a3be257f22f75a00b0a13ee34#diff-aea804e6c093940044bce81458b5407920d4cc070b6b123e4c98014171f46966 |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |