ty icon indicating copy to clipboard operation
ty copied to clipboard

Wrong function argument inlay hint for overloaded function

Open benruijl opened this issue 1 month ago • 1 comments

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
Wrong type hint

Here is the playground link:

https://play.ty.dev/0a5f6d13-1e2d-4fca-adef-80af38cf120f

Version

No response

benruijl avatar Dec 17 '25 08:12 benruijl

Thank you for reporting this!

sharkdp avatar Dec 17 '25 08:12 sharkdp