Skip to content

Walrus narrowing not propagated from inside expression #19430

@hauntsaninja

Description

@hauntsaninja
def main(cond: bool) -> None:
    woo = None
    if cond and (woo := 5) in range(10):
        reveal_type(woo)  # should reveal int, reveals int | None

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions