Skip to content

Diagnostic shows wrong type in unpack assignment #1580

@sharkdp

Description

@sharkdp

The diagnostic message in the following example should say "Object of type int is not assignable to str":

x: str = ""

def returns_tuple() -> tuple[int, int]:
    return (0, 0)

# Object of type `tuple[int, int]` is not assignable to `str`
x, y = returns_tuple()

https://play.ty.dev/29ce53bf-0300-4f30-b00d-c30480f7f497

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdiagnosticsRelated to reporting of diagnostics.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions