Skip to content

Narrow down right hand-side of an == expression in ifs #9093

@elenakrittik

Description

@elenakrittik

Is your feature request related to a problem? Please describe.

if a == 1 narrows a to Literal[1], but if 1 == a does not

playground

Describe the solution you’d like

Narrow down the type of a in both cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions