ty icon indicating copy to clipboard operation
ty copied to clipboard

Bidirectional inference fails in assignments that use unpacking

Open AlexWaygood opened this issue 6 days ago • 1 comments

E.g.

from typing import TypedDict

class Foo(TypedDict):
    x: int

x: Foo

# error: Object of type `dict[Unknown | str, Unknown | int]` is not assignable to `Foo`
x, _ = {"x": 42}, 56

Probably not a top priority, but an inconsistency I noticed when looking at https://github.com/astral-sh/ty/issues/2161

AlexWaygood avatar Dec 22 '25 15:12 AlexWaygood