Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions mypy/fastparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,10 @@ def visit_Index(self, n: Index) -> Node:
# cast for mypyc's benefit on Python 3.9
return self.visit(cast(Any, n).value)

def visit_Match(self, n: Any) -> None:
self.fail("Match statement is not supported",
line=n.lineno, column=n.col_offset, blocker=True)


class TypeConverter:
def __init__(self,
Expand Down
2 changes: 2 additions & 0 deletions mypy/test/testcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
typecheck_files.append('check-python38.test')
if sys.version_info >= (3, 9):
typecheck_files.append('check-python39.test')
if sys.version_info >= (3, 10):
typecheck_files.append('check-python310.test')

# Special tests for platforms with case-insensitive filesystems.
if sys.platform in ('darwin', 'win32'):
Expand Down
7 changes: 7 additions & 0 deletions test-data/unit/check-python310.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[case testMatchStatementNotSupported]
# flags: --python-version 3.10
match str(): # E: Match statement is not supported
case 'x':
1 + ''
case _:
1 + b''