-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
crashsemantic-analyzerProblems that happen during semantic analysisProblems that happen during semantic analysistopic-pep-695Issues related to PEP 695 syntaxIssues related to PEP 695 syntaxtopic-type-variables
Description
Crash Report
This crashes on master:
T = NotDefined
class A[T]: ...
Does not reproduce when using a generic function (def f[T](): ...
) or when T
has some other non-type-variable value (T = 1
)
Traceback
TESTFILES/SCRATCH.py:2: 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: 1.18.0+dev.ad76e1628e2d4fe52d89a80d51890bf84afad38f
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/brian/Projects/open-contrib/mypy/mypy/__main__.py", line 37, in <module>
console_entry()
File "/home/brian/Projects/open-contrib/mypy/mypy/__main__.py", line 15, in console_entry
main()
File "/home/brian/Projects/open-contrib/mypy/mypy/main.py", line 127, in main
res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
File "/home/brian/Projects/open-contrib/mypy/mypy/main.py", line 211, in run_build
res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 191, in build
result = _build(
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 267, in _build
graph = dispatch(sources, manager, stdout)
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 2939, in dispatch
process_graph(graph, manager)
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 3337, in process_graph
process_stale_scc(graph, scc, manager)
File "/home/brian/Projects/open-contrib/mypy/mypy/build.py", line 3432, in process_stale_scc
mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors)
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal_main.py", line 95, in semantic_analysis_for_scc
process_top_levels(graph, scc, patches)
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal_main.py", line 222, in process_top_levels
deferred, incomplete, progress = semantic_analyze_target(
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal_main.py", line 399, in semantic_analyze_target
analyzer.refresh_partial(
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal.py", line 652, in refresh_partial
self.refresh_top_level(node)
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal.py", line 670, in refresh_top_level
self.accept(d)
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal.py", line 7314, in accept
node.accept(self)
~~~~~~~~~~~^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/nodes.py", line 1249, in accept
return visitor.visit_class_def(self)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal.py", line 1769, in visit_class_def
self.analyze_class(defn)
~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal.py", line 1910, in analyze_class
bases, tvar_defs, is_protocol = self.clean_up_bases_and_infer_type_variables(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
defn, bases, context=defn
^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/brian/Projects/open-contrib/mypy/mypy/semanal.py", line 2215, in clean_up_bases_and_infer_type_variables
assert isinstance(node.node, TypeVarLikeExpr)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError:
Metadata
Metadata
Assignees
Labels
crashsemantic-analyzerProblems that happen during semantic analysisProblems that happen during semantic analysistopic-pep-695Issues related to PEP 695 syntaxIssues related to PEP 695 syntaxtopic-type-variables