Skip to content

Compound if expressions appear to be resolved backwards when checking dict contents #237

Open
@bigfootjon

Description

@bigfootjon

Describe the Bug

See the sandbox, pyrefly is inferring a type as a literal when the if statement checks the exact opposite of that.

Note that removing the not does nothing which suggests that the not is not being considered when specializing the type

Sandbox Link

https://pyrefly.org/sandbox/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoCGAzkQKZ4D68CpAULcGGAFxQAmSAxjANpEwgANFH4gAulAC8UAN4BfekmBQARIzArMKKOsIo2OpjzVMVEpESgow+FcRXNaUZ1ABuBADZTDYY+rNOLsRklNSkABTuHsKiAJRAA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions