[red-knot] Improve match mdtests (#14951)

## Summary

Minor improvement for the `match` tests to make sure we can't infer
statically whether or not a certain `case` applies.
This commit is contained in:
David Peter 2024-12-13 09:50:17 +01:00 committed by GitHub
parent c1837e4189
commit 2ccc9b19a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,7 +3,8 @@
## With wildcard
```py
match 0:
def _(target: int):
match target:
case 1:
y = 2
case _:
@ -15,7 +16,8 @@ reveal_type(y) # revealed: Literal[2, 3]
## Without wildcard
```py
match 0:
def _(target: int):
match target:
case 1:
y = 2
case 2:
@ -29,10 +31,11 @@ reveal_type(y)
## Basic match
```py
def _(target: int):
y = 1
y = 2
match 0:
match target:
case 1:
y = 3
case 2: