-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTERNAL ERROR when using typing.ParamSpec
#16257
Comments
I confirmed that this still reproduces on 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_pass
self.type_checker().check_first_pass()
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 477, in check_first_pass
self.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 accept
return visitor.visit_overloaded_func_def(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 624, in visit_overloaded_func_def
self._visit_overloaded_func_def(defn)
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 654, in _visit_overloaded_func_def
self.check_overlapping_overloads(defn)
File "C:\Users\alexw\coding\mypy\mypy\checker.py", line 764, in check_overlapping_overloads
if 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_signatures
return 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 in callable.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 in callable.arg_types]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\expandtype.py", line 71, in expand_type
return typ.accept(ExpandTypeVisitor(env))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\types.py", line 1954, in accept
return visitor.visit_callable_type(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alexw\coding\mypy\mypy\expandtype.py", line 350, in visit_callable_type
return 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__
assert not t.prefix.arg_types
AssertionError: |
14418bc again (cc. @ilevkivskyi) |
Fix in #16257 |
This is essentially the same story as the other two crashes. |
Fixes #16257 Parenthesis strike back. I hope this is the last place where I had put them wrong.
@evhub Thanks for coconut! Did you encounter the regression on an open source codebase? |
@hauntsaninja Thanks! And yep, it showed up in Coconut's type stub for |
Fixes #16257 Parenthesis strike back. I hope this is the last place where I had put them wrong.
Crash Report
MyPy INTERNAL ERROR when running reproduction code below.
Traceback
To Reproduce
Reproduction code:
Your Environment
--show-traceback
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: