Closed
Description
Simple to reproduce, mypy 0.782.
#!/usr/bin/env python
from typing import *
from functools import lru_cache
@overload
def f(a: str, b: str) -> int: ...
@overload
def f(a: str) -> str: ...
@lru_cache
def f(a: str, b: Optional[str] = None) -> Union[str, int]:
if b is not None:
return 123
else:
return 'abc'
mypy --strict --show-traceback .
./example.py:5: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.782
Traceback (most recent call last):
File "mypy/checker.py", line 401, in accept
File "mypy/nodes.py", line 515, in accept
File "mypy/checker.py", line 434, in visit_overloaded_func_def
File "mypy/checker.py", line 461, in _visit_overloaded_func_def
File "mypy/checker.py", line 482, in check_overlapping_overloads
AssertionError:
./example.py:5: : note: use --pdb to drop into pdb
Also happens with master: version: 0.790+dev.ffdbeb3d47ccb2d9691b36993be0a18e0718d997
Metadata
Metadata
Assignees
Labels
No labels