8000 Exhaustiveness checking for match statements by JukkaL · Pull Request #12267 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Exhaustiveness checking for match statements #12267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Mar 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add failing test case
  • Loading branch information
JukkaL committed Mar 1, 2022
commit a79c4c277eaef09199ebe3ec06e369b03b4a15e8
13 changes: 13 additions & 0 deletions test-data/unit/check-python310.test
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,19 @@ def g(c: C) -> int:
return 1
assert False

[case testMatchAsPatternIntersection-skip]
class A: pass
class B: pass
class C: pass

def f(x: A) -> None:
match x:
case B() as y:
reveal_type(y) # N: Revealed type is "__main__.<subclass of "A" and "B">"
case C() as y:
reveal_type(y) # N: Revealed type is "__main__.<subclass of "A" and "C">"
reveal_type(y) # N: Revealed type is "Union[__main__.<subclass of "A" and "B">, __main__.<subclass of "A" and "C">]"

-- Misc

[case testMatchAndWithStatementScope]
Expand Down
0