Skip to content
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

Fix crash when encountering match statement #11749

Merged
merged 1 commit into from Dec 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion mypy/fastparse.py
Expand Up @@ -1286,9 +1286,11 @@ 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:
def visit_Match(self, n: Any) -> Node:
self.fail("Match statement is not supported",
line=n.lineno, column=n.col_offset, blocker=True)
# Just return some valid node
return PassStmt()


class TypeConverter:
Expand Down