ty
ty copied to clipboard
Wrong function argument inlay hint for overloaded function
Summary
This small script gives a wrong type hint for the argument x and y which should be part of *names but are interpreted as the value for name and the is_symmetric argument of another overloaded variant:
from typing import overload, Optional, Sequence
@overload
def S(name: str, is_symmetric: Optional[bool] = None) -> str:
pass
@overload
def S(*names: str, is_symmetric: Optional[bool] = None) -> Sequence[str]:
pass
def S():
pass
b = S('x', 'y') # argument hints for the wrong overloaded variant, return type is correct
Here is the playground link:
https://play.ty.dev/0a5f6d13-1e2d-4fca-adef-80af38cf120f
Version
No response
Thank you for reporting this!