Skip to content

variable on right side of walrus operator is not narrowed #2947

@DetachHead

Description

@DetachHead

Summary

def foo(value: int | None):
    if foo := value:
        reveal_type(value)  # int | None, should be int

https://play.ty.dev/c4f152a1-89a6-4ea0-bed4-16c248dce13b

Version

0.0.20

Metadata

Metadata

Assignees

Labels

narrowingrelated to flow-sensitive type narrowing

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions