Commit 16ee558
committed
fix: Preserve narrowing in chained-comparison operands
A regression was introduced that caused loss of type inference for operands in chained comparisons, such as `None is not a == b`. The logic to prevent unwanted type widening was too aggressive and discarded valid narrowing from `is not` checks.
The fix adjusts the condition in `update_from_options` to allow updates when only a single frame is being merged. This correctly identifies sequential updates within expressions (like chained comparisons) and preserves the narrowing, while still preventing unwanted widening when merging multiple control-flow branches.1 parent bdb0dd4 commit 16ee558
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
340 | 345 | | |
341 | 346 | | |
342 | 347 | | |
| |||
0 commit comments