Skip to content

fix Narrowing lost after excluding the only None case #3374#4114

Open
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:3374
Open

fix Narrowing lost after excluding the only None case #3374#4114
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:3374

Conversation

@asukaminato0721

Copy link
Copy Markdown
Contributor

Summary

Fixes #3374

Tracks when a terminating guard excludes both optional values being None.
Applies the implied narrowing when either value is subsequently proven None.
Invalidates the relationship on reassignment and preserves it only across valid flow merges.

Test Plan

add test

@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. ✅

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.

Narrowing lost after excluding the only None case

1 participant