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
MyPy INTERNAL ERROR when running reproduction code below.
Traceback
break_mypy.py:32: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
break_mypy.py:32: 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.6.0
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "mypy\checker.py", line 585, in accept
File "mypy\nodes.py", line 588, in accept
File "mypy\checker.py", line 622, in visit_overloaded_func_def
File "mypy\checker.py", line 652, in _visit_overloaded_func_def
File "mypy\checker.py", line 762, in check_overlapping_overloads
File "mypy\checker.py", line 7268, in is_unsafe_overlapping_overload_signatures
File "mypy\subtypes.py", line 1425, in is_callable_compatible
File "mypy\subtypes.py", line 1749, in unify_generic_callable
File "mypy\applytype.py", line 129, in apply_generic_arguments
File "mypy\expandtype.py", line 71, in expand_type
File "mypy\types.py", line 1953, in accept
File "mypy\expandtype.py", line 342, in visit_callable_type
File "mypy\types.py", line 1877, in copy_modified
File "mypy\types.py", line 1811, in __init__
AssertionError:
break_mypy.py:32: : note: use --pdb to drop into pdb
I confirmed that this still reproduces on master, and with the latest version of the release-1.6 branch. Here's the stack trace on the master branch, using uncompiled mypy:
break_mypy.py:9: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
break_mypy.py:9: 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.7.0+dev.72605dc12a89b9c12a502ebfad494b4b9d9b5160
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\alexw\coding\mypy\venv\Scripts\mypy.exe\__main__.py", line 7, in <module>
sys.exit(console_entry())
File "C:\Users\alexw\coding\mypy\mypy\__main__.py", line 15, in console_entry
main()
File "C:\Users\alexw\coding\mypy\mypy\main.py", line 99, in main
res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
File "C:\Users\alexw\coding\mypy\mypy\main.py", line 178, in run_build
res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
File "C:\Users\alexw\coding\mypy\mypy\build.py", line 189, in build
result = _build(
File "C:\Users\alexw\coding\mypy\mypy\build.py", line 262, in _build
graph = dispatch(sources, manager, stdout)
File "C:\Users\alexw\coding\mypy\mypy\build.py", line 2938, in dispatch
process_graph(graph, manager)
File "C:\Users\alexw\coding\mypy\mypy\build.py", line 3336, in process_graph
process_stale_scc(graph, scc, manager)
File "C:\Users\alexw\coding\mypy\mypy\build.py", line 3437, in process_stale_scc
graph[id].type_check_first_pass()
File "C:\Users\alexw\coding\mypy\mypy\build.py", line 2306, in type_check_first_passself.type_checker().check_first_pass()
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 477, in check_first_passself.accept(d)
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 587, in accept
stmt.accept(self)
File "C:\Users\alexw\coding\mypy\mypy\nodes.py", line 575, in acceptreturn visitor.visit_overloaded_func_def(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 624, in visit_overloaded_func_defself._visit_overloaded_func_def(defn)
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 654, in _visit_overloaded_func_defself.check_overlapping_overloads(defn)
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 764, in check_overlapping_overloadsif is_unsafe_overlapping_overload_signatures(sig1, sig2, type_vars):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 7353, in is_unsafe_overlapping_overload_signaturesreturn is_callable_compatible(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\subtypes.py", line 1484, in is_callable_compatible
unified = unify_generic_callable(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\subtypes.py", line 1821, in unify_generic_callable
applied = mypy.applytype.apply_generic_arguments(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\applytype.py", line 129, in apply_generic_arguments
arg_types=[expand_type(at, id_to_type) for at incallable.arg_types]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\applytype.py", line 129, in <listcomp>
arg_types=[expand_type(at, id_to_type) for at incallable.arg_types]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\expandtype.py", line 71, in expand_typereturn typ.accept(ExpandTypeVisitor(env))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\types.py", line 1954, in acceptreturn visitor.visit_callable_type(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\expandtype.py", line 350, in visit_callable_typereturn t.copy_modified(
^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\types.py", line 1878, in copy_modified
modified = CallableType(
^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\types.py", line 1812, in __init__assertnot t.prefix.arg_types
AssertionError:
14418bc3d2c38b9ea776da6029e9d9dc6650b7ea is the first bad commit
commit 14418bc3d2c38b9ea776da6029e9d9dc6650b7ea
Author: Ivan Levkivskyi <levkivskyi@gmail.com>
Date: Tue Aug 15 20:31:26 2023 +0100
Polymorphic inference: support for parameter specifications and lambdas (#15837)
Activity
AlexWaygood commentedon Oct 13, 2023
I confirmed that this still reproduces on
master, and with the latest version of therelease-1.6branch. Here's the stack trace on themasterbranch, using uncompiled mypy:AlexWaygood commentedon Oct 13, 2023
14418bc again (cc. @ilevkivskyi)
ilevkivskyi commentedon Oct 13, 2023
Fix in #16257
ilevkivskyi commentedon Oct 13, 2023
This is essentially the same story as the other two crashes.
Fix crash on ParamSpec unification (for real) (#16259)
hauntsaninja commentedon Oct 13, 2023
@evhub Thanks for coconut! Did you encounter the regression on an open source codebase?
evhub commentedon Oct 13, 2023
@hauntsaninja Thanks! And yep, it showed up in Coconut's type stub for
call: https://github.com/evhub/coconut/blob/master/__coconut__/__init__.pyi#L256Fix crash on ParamSpec unification (for real) (#16259)