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
*** INTERNAL ERROR ***
asd4.py:7: error: Internal error -- please report a bug at https://github.com/python/mypy/issues
NOTE: you can use "mypy --pdb ..." to drop into the debugger when this happens.
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.4/mypy", line 6, in <module>
main(__file__)
File "/usr/lib64/python3.4/site-packages/mypy/main.py", line 40, in main
res = type_check_only(sources, bin_dir, options)
File "/usr/lib64/python3.4/site-packages/mypy/main.py", line 81, in type_check_only
options=options)
File "/usr/lib64/python3.4/site-packages/mypy/build.py", line 177, in build
dispatch(sources, manager)
File "/usr/lib64/python3.4/site-packages/mypy/build.py", line 1331, in dispatch
process_graph(graph, manager)
File "/usr/lib64/python3.4/site-packages/mypy/build.py", line 1469, in process_graph
process_stale_scc(graph, scc)
File "/usr/lib64/python3.4/site-packages/mypy/build.py", line 1542, in process_stale_scc
graph[id].semantic_analysis()
File "/usr/lib64/python3.4/site-packages/mypy/build.py", line 1296, in semantic_analysis
self.manager.semantic_analyzer.visit_file(self.tree, self.xpath)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 243, in visit_file
self.accept(d)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 2306, in accept
node.accept(self)
File "/usr/lib64/python3.4/site-packages/mypy/nodes.py", line 660, in accept
return visitor.visit_class_def(self)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 564, in visit_class_def
defn.defs.accept(self)
File "/usr/lib64/python3.4/site-packages/mypy/nodes.py", line 723, in accept
return visitor.visit_block(self)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 1014, in visit_block
self.accept(s)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 2306, in accept
node.accept(self)
File "/usr/lib64/python3.4/site-packages/mypy/nodes.py", line 544, in accept
return visitor.visit_decorator(self)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 1626, in visit_decorator
dec.func.accept(self)
File "/usr/lib64/python3.4/site-packages/mypy/nodes.py", line 475, in accept
return visitor.visit_func_def(self)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 316, in visit_func_def
self.analyze_function(defn)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 468, in analyze_function
defn.type = self.anal_type(defn.type)
File "/usr/lib64/python3.4/site-packages/mypy/semanal.py", line 1039, in anal_type
return t.accept(a)
File "/usr/lib64/python3.4/site-packages/mypy/types.py", line 606, in accept
return visitor.visit_callable_type(self)
File "/usr/lib64/python3.4/site-packages/mypy/typeanal.py", line 204, in visit_callable_type
return t.copy_modified(arg_types=self.anal_array(t.arg_types),
File "/usr/lib64/python3.4/site-packages/mypy/typeanal.py", line 274, in anal_array
res.append(t.accept(self))
File "/usr/lib64/python3.4/site-packages/mypy/types.py", line 606, in accept
return visitor.visit_callable_type(self)
File "/usr/lib64/python3.4/site-packages/mypy/typeanal.py", line 204, in visit_callable_type
return t.copy_modified(arg_types=self.anal_array(t.arg_types),
File "/usr/lib64/python3.4/site-packages/mypy/typeanal.py", line 274, in anal_array
res.append(t.accept(self))
File "/usr/lib64/python3.4/site-packages/mypy/types.py", line 448, in accept
return visitor.visit_type_var(self)
File "/usr/lib64/python3.4/site-packages/mypy/typeanal.py", line 201, in visit_type_var
raise RuntimeError('TypeVarType is already analyzed')
RuntimeError: TypeVarType is already analyzed
Removing the Generic subclassing also triggers it.
The text was updated successfully, but these errors were encountered:
Looking into this, but making slow progress. I just rediscovered that removing Generic[T] from the base still triggers this. The immediate cause seems to be that the type of cls in the class method is derived from the constructor signature, but apparently if that contains type variables it always thinks it's a generic function, and that always causes this crash.
So there are really two bugs -- the crash when the constructor is actually a generic function; and the way the cls type believes the constructor is a generic function even when its type variable belongs to the class.
The raise caused two specific errors that are now fixed. The fix
causes no new errors. I don't understand what's going on, but the
raise has been there since prehistoric times, and may well have been
misguided in the first place.
Fixes#1898.
Stacktrack very closely related to #1682, but unable to find a way to related both issues.
gives
Removing the
Generic
subclassing also triggers it.The text was updated successfully, but these errors were encountered: