-
Notifications
You must be signed in to change notification settings - Fork 375
in operation on tuple of Literal doesn't narrow type #3474
Copy link
Copy link
Labels
help wantedLarger than "good first issue", but still well-defined and ready for someone to pick upLarger than "good first issue", but still well-defined and ready for someone to pick upnarrowingIssues with narrowing - root cause is usually narrowing, flow handling, or bothIssues with narrowing - root cause is usually narrowing, flow handling, or bothtypechecking
Metadata
Metadata
Assignees
Labels
help wantedLarger than "good first issue", but still well-defined and ready for someone to pick upLarger than "good first issue", but still well-defined and ready for someone to pick upnarrowingIssues with narrowing - root cause is usually narrowing, flow handling, or bothIssues with narrowing - root cause is usually narrowing, flow handling, or bothtypechecking
Type
Fields
Give feedbackNo fields configured for Feature.
Describe the Bug
When
severity_level_stris checked to be inSEVERITY_LEVELS, this should narrow the type toSeverityLevelsince onlySeverityLevels are present in the tuple. In practice however, Pyrefly doesn't perform any narrowing based on the condition,severity_level_stris still just astrinstead ofSeverityLevelwithin the condition body.Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0AqADroRAZRgA3GJQhMAMlJhQ6AXjry5M1FADaQkFAhsAFgwMAaOgZqtel6yBqoAVvZABdcQFEAat4AlAEkAFQBNAH15P295MTU6AGNUOAYACgYAV2JYXQlpWQUlKCtCMo8rNhgGCNRKNjg0-Jk5UkVpKABKTpEROCVC0gjYDojUykQ6cYSDI1NzEBEIMCmB1uHisYZKTnQ6MRjg8KiYuMQROku6SiUdCKZiGDT%2BgvWR5S3KHvQQCxAyG5gKCkQgMWhQCgAYjoAAVSIDgVMMDgCElcOhIGxMpRUAwIOjCCJoRIYHQzAxiHBEAB6akAmBAkG8NjUmDoamYXCJODUxLozHY3H49l0MC8OioSSoaCobCwNEY4yCvHoui4Ygq9BwQnoMgMEzogC0BTgwpmIAAzIQAIwAJgMIl0MmolDgXnQmXQXB4fBgmENmAgN0SeOkCQA5MZ0LwYOGRNGGIabgBHTJBv2GgDWMFIhtQiUS8DgEYA7nV0HGfgBfP750MwABi0BgFDQWDwRDIICrQA
(Only applicable for extension issues) IDE Information
No response