Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Dict unpacking propagates wrong type #412

Description

@jakebailey
a, b = {1: "x", 2.0: 1j}

The way iterable unpacking works, a and b should have types based on the keys of the dict, since that's what you get when you convert to the functionally equivalent:

d = {1: "x", 2.0: 1j}
it = iter(d)
a = it.next()
b = it.next()

But, we get:

image

image

a is being given the value type, and b probably the first value's type.

Likely related is what happens when changing this to:

a, *b = {1: "x", 2.0: 1j}

b has no type, but should be a list.

Found in #334.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggenfrom the generated tests

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions