You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a05.py:10: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.990+dev.7c14feedd2a6889d9eab8b0ac8dc8aab630bbed3
Traceback (most recent call last):
File "/Users/tintvrtkovic/hr/shop-service/.venv/bin/mypy", line 8, in <module>
sys.exit(console_entry())
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/__main__.py", line 15, in console_entry
main()
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/main.py", line 95, in main
res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/main.py", line 174, in run_build
res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/build.py", line 188, in build
result = _build(
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/build.py", line 271, in _build
graph = dispatch(sources, manager, stdout)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/build.py", line 2885, in dispatch
process_graph(graph, manager)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/build.py", line 3269, in process_graph
process_stale_scc(graph, scc, manager)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/build.py", line 3370, in process_stale_scc
graph[id].type_check_first_pass()
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/build.py", line 2302, in type_check_first_pass
self.type_checker().check_first_pass()
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/checker.py", line 462, in check_first_pass
self.accept(d)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/checker.py", line 570, in accept
stmt.accept(self)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/nodes.py", line 1559, in accept
return visitor.visit_match_stmt(self)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/checker.py", line 4551, in visit_match_stmt
inferred_types = self.infer_variable_types_from_type_maps(type_maps)
File "/Users/tintvrtkovic/hr/shop-service/.venv/lib/python3.10/site-packages/mypy/checker.py", line 4600, in infer_variable_types_from_type_maps
assert isinstance(node, Var)
AssertionError:
a05.py:10: : note: use --pdb to drop into pdb
To Reproduce
A few code snippets for context (imports omitted for clarity).
)
Fixes#16793. Fixes crash in #13666.
Previously mypy considered that variables in match/case patterns must be
Var's, causing a hard crash when a name of captured pattern clashes with
a name of some existing function. This PR removes such assumption about
Var and allows other nodes.
Crash Report
Mypy crashes when run over a match statement.
Traceback
To Reproduce
A few code snippets for context (imports omitted for clarity).
This works:
This doesn't type-check (but should), but no crash:
And finally, the crash:
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: