Skip to content

Annotating an instance attribute with Final means no type is shown when hovering over it #2509

@qmg-tmay

Description

@qmg-tmay

Summary

When a field is set without a explicit type hint, hovering over the instance member correctly infers the type (inherited from the method arguments):

Image

However, if the typing.Final type hint is used, hovering now reveals the type to be Unknown:

Image

Subsequent usages of the instance member do correctly infer the type as str

Version

ty 0.0.12 (Homebrew 2026-01-14)

Metadata

Metadata

Assignees

Labels

serverRelated to the LSP server

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions