Skip to content

fix TypeIs[T] with free TypeVar produces no narrowing #4849 - #4867

Closed
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:4849
Closed

asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:4849

Conversation

@asukaminato0721

Copy link
Copy Markdown
Collaborator

Summary

Fixes #4849

TypeIs[T] now narrows using T's bound when arguments cannot determine T, while keeping the negative branch conservative.

Test Plan

add test

@meta-cla meta-cla Bot added the cla signed label Sep 9, 2026
@github-actions github-actions Bot added the size/m label Sep 9, 2026
@meta-codesync

meta-codesync Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D119300489. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@github-actions

Copy link
Copy Markdown

Closing this PR because linked issue #4849 was closed.

@github-actions github-actions Bot closed this Sep 29, 2026
@asukaminato0721
asukaminato0721 deleted the 4849 branch September 29, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeIs[T] with free TypeVar produces no narrowing

2 participants