Skip to content

Wrong function argument inlay hint for overloaded function #1985

@benruijl

Description

@benruijl

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingserverRelated to the LSP server

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions