| 1 |
[case testMatchUndefinedSubject] |
| 2 |
import typing |
| 3 |
match x: |
| 4 |
case _: |
| 5 |
pass |
| 6 |
[out] |
| 7 |
main:2: error: Name "x" is not defined |
| 8 |
|
| 9 |
[case testMatchUndefinedValuePattern] |
| 10 |
import typing |
| 11 |
x = 1 |
| 12 |
match x: |
| 13 |
case a.b: |
| 14 |
pass |
| 15 |
[out] |
| 16 |
main:4: error: Name "a" is not defined |
| 17 |
|
| 18 |
[case testMatchUndefinedClassPattern] |
| 19 |
import typing |
| 20 |
x = 1 |
| 21 |
match x: |
| 22 |
case A(): |
| 23 |
pass |
| 24 |
[out] |
| 25 |
main:4: error: Name "A" is not defined |
| 26 |
|
| 27 |
[case testNoneBindingWildcardPattern] |
| 28 |
import typing |
| 29 |
x = 1 |
| 30 |
match x: |
| 31 |
case _: |
| 32 |
_ |
| 33 |
[out] |
| 34 |
main:5: error: Name "_" is not defined |
| 35 |
|
| 36 |
[case testNoneBindingStarredWildcardPattern] |
| 37 |
import typing |
| 38 |
x = 1 |
| 39 |
match x: |
| 40 |
case [*_]: |
| 41 |
_ |
| 42 |
[out] |
| 43 |
main:5: error: Name "_" is not defined |