Repository navigation
Closed
Labels
Description
Crash Report
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
To Reproduce
Reproduction code:
from typing import *
_T = TypeVar("_T")
_U = TypeVar("_U")
_V = TypeVar("_V")
_W = TypeVar("_W")
_P = ParamSpec("_P")
@overload
def call(
_func: Callable[Concatenate[_T, _P], _U],
_x: _T,
*args: Any,
**kwargs: Any,
) -> _U: ...
@overload
def call(
_func: Callable[Concatenate[_T, _U, _P], _V],
_x: _T,
_y: _U,
*args: Any,
**kwargs: Any,
) -> _V: ...Your Environment
- Mypy version used: mypy 1.6.0 (compiled: yes)
- Mypy command-line flags:
--show-traceback - Mypy configuration options from
mypy.ini(and other config files): None - Python version used: Python 3.11.4
- Operating system and version: Windows 11
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)