Skip to content

[red-knot] No error when using some types symbols without importing them #15476

@sharkdp

Description

@sharkdp

Red Knot does not raise any errors when using some symbols from types without importing them. I haven't done an exhaustive investigation, but all of these should raise errors:

a: Literal[2] =   # no error here
b: Any = 2  # no error here
c: Never = 3
d: Annotated[int, "…"] = 2
e: Union[int, str] = 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicatetyMulti-file analysis & type inference

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions