Skip to content

Type aliases are expanded in the hover text #2707

@oyarsa

Description

@oyarsa

Describe the Bug

type Messages = list[str]

def func(msgs: Messages) -> None: pass

When hovering func, I'd expect it to show msgs: Messages, but it shows msgs: list[str]. Is this intended or a bug? One of the main reasons for using aliases is documentation.

This happens in both type statements and TypeAlias.

pyrefly (playground):

(function) func: def func(msgs: list[str]) -> None: ...

pyright (playground)

(function) def func(msgs: Messages) -> None

Metadata

Metadata

Assignees

No one assigned

    Labels

    language-serverIssues specific to our IDE integration rather than type checkingtypechecking
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions