mypy icon indicating copy to clipboard operation
mypy copied to clipboard

(🐞) Positional only parameter syntax doesn't show in overload error messages

Open KotlinIsland opened this issue 3 years ago • 0 comments

from typing import overload

@overload
def foo(a: int, /): ...
@overload
def foo(a: str): ...
def foo(a): ...


foo(a=1)
# main.py:10: error: No overload variant of "foo" matches argument type "int"
# main.py:10: note: Possible overload variants:
# main.py:10: note:     def foo(a, int) -> Any
# main.py:10: note:     def foo(a: str) -> Any

The error message is now incorrect.

playground

KotlinIsland avatar Aug 07 '22 04:08 KotlinIsland