Closed
Description
Similar crash as in #5192; happening with current pip master.
$ # In a venv with only mypy installed.
$ git clone https://github.com/pypa/pip.git --depth=1
[...]
$ cd pip
$ git fetch origin deeb1e493d8947a957c86bf256e7f5fa91c92e52
$ git checkout deeb1e493d8947a957c86bf256e7f5fa91c92e52
$ # Populate the cache; there's 2 errors as expected.
$ mypy src
[...]
$ # This run will crash
$ mypy src
Traceback (most recent call last):
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/bin/mypy", line 11, in <module>
sys.exit(console_entry())
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/__main__.py", line 7, in console_entry
main(None)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/main.py", line 91, in main
res = type_check_only(sources, bin_dir, options, flush_errors, fscache) # noqa
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/main.py", line 148, in type_check_only
fscache=fscache)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/build.py", line 183, in build
flush_errors, fscache)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/build.py", line 356, in _build
graph = dispatch(sources, manager)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/build.py", line 2543, in dispatch
process_graph(graph, manager)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/build.py", line 2833, in process_graph
process_fresh_modules(graph, prev_scc, manager)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/build.py", line 2919, in process_fresh_modules
graph[id].fix_cross_refs()
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/build.py", line 1927, in fix_cross_refs
self.options.use_fine_grained_cache)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/fixup.py", line 24, in fixup_module
node_fixer.visit_symbol_table(tree.names)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/fixup.py", line 89, in visit_symbol_table
value.node.accept(self)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/nodes.py", line 2582, in accept
return visitor.visit_type_alias(self)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/fixup.py", line 135, in visit_type_alias
a.target.accept(self.type_fixer)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/types.py", line 501, in accept
return visitor.visit_instance(self)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/fixup.py", line 149, in visit_instance
inst.type = lookup_qualified_typeinfo(self.modules, type_ref, self.quick_and_dirty)
File "/Users/pradyunsg/.virtualenvs/tmp-646a2fd8b91d920/lib/python3.7/site-packages/mypy/fixup.py", line 239, in lookup_qualified_typeinfo
assert quick_and_dirty, "Should never get here in normal mode"
AssertionError: Should never get here in normal mode
I haven't tested with master (internet access is patchy for me atm) but this does occur for mypy 0.630 on Python 3.7.0.