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
from typing import TypeVar, NamedTuple, Generic
T = TypeVar('T')
class C(NamedTuple('C', [('x', T),]), Generic[T]):
def get(self):
# type: () -> T
pass
Traceback (most recent call last):
File "/home/gregprice/w/mypy/env/bin/mypy", line 12, in <module>
exec(compile(open(__file__).read(), __file__, 'exec'))
File "/home/gregprice/w/mypy/scripts/mypy", line 6, in <module>
main(__file__)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/main.py", line 54, in main
res = type_check_only(sources, bin_dir, options)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/main.py", line 102, in type_check_only
python_path=options.python_path)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/build.py", line 211, in build
dispatch(sources, manager)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/build.py", line 1336, in dispatch
process_graph(graph, manager)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/build.py", line 1467, in process_graph
process_stale_scc(graph, scc)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/build.py", line 1493, in process_stale_scc
graph[id].semantic_analysis()
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/build.py", line 1303, in semantic_analysis
self.manager.semantic_analyzer.visit_file(self.tree, self.xpath)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/semanal.py", line 247, in visit_file
self.accept(d)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/semanal.py", line 2283, in accept
node.accept(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/nodes.py", line 650, in accept
return visitor.visit_class_def(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/semanal.py", line 567, in visit_class_def
defn.defs.accept(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/nodes.py", line 715, in accept
return visitor.visit_block(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/semanal.py", line 1018, in visit_block
self.accept(s)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/semanal.py", line 2283, in accept
node.accept(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/nodes.py", line 462, in accept
return visitor.visit_func_def(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/semanal.py", line 322, in visit_func_def
self.analyze_function(defn)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/semanal.py", line 474, in analyze_function
defn.type = self.anal_type(defn.type)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/semanal.py", line 1043, in anal_type
return t.accept(a)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/types.py", line 496, in accept
return visitor.visit_callable_type(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/typeanal.py", line 189, in visit_callable_type
return t.copy_modified(arg_types=self.anal_array(t.arg_types),
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/typeanal.py", line 259, in anal_array
res.append(t.accept(self))
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/types.py", line 637, in accept
return visitor.visit_tuple_type(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/typeanal.py", line 203, in visit_tuple_type
return TupleType(self.anal_array(t.items), fallback, t.line)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/typeanal.py", line 259, in anal_array
res.append(t.accept(self))
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/types.py", line 340, in accept
return visitor.visit_type_var(self)
File "/home/gregprice/w/mypy/env/lib/python3.4/site-packages/mypy/typeanal.py", line 186, in visit_type_var
raise RuntimeError('TypeVarType is already analyzed')
RuntimeError: TypeVarType is already analyzed
*** INTERNAL ERROR ***
/tmp/foo.py:6: error: Internal error -- please report a bug at https://github.com/python/mypy/issues
This looks a lot like #685 originally did, but the repro there no longer crashes.
Spotted this in python/typeshed#236 -- this repro is a reduction of that code. The difference from the repros in #658 that no longer crash seems to be the method definition.
The text was updated successfully, but these errors were encountered:
This program causes mypy to crash:
This looks a lot like #685 originally did, but the repro there no longer crashes.
Spotted this in python/typeshed#236 -- this repro is a reduction of that code. The difference from the repros in #658 that no longer crash seems to be the method definition.
The text was updated successfully, but these errors were encountered: