Skip to content

[red-knot] Bug in reachability constraint merging #17723

@sharkdp

Description

@sharkdp

Combining reachability constraints does not seem to work as expected. Consider the following example where we fail to see that print(x) is unreachable:

def _(cond: bool):
    if cond:
        if True:
            pass
        else:
            print(x)  # should not be reachable, i.e. not emit an error

https://types.ruff.rs/cc26b966-0df2-4111-8448-2a1d15d95586

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtyMulti-file analysis & type inference

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions