Repository navigation
Commit 7c82673
Preserve one-sided conditional holders whose consequent already holds in the other branch
An if-merge intersects conditional expression holders by exact key, so a
holder recorded only in one branch is dropped even when the other branch's
flat state for the holder's target already satisfies the consequent - a
subtype with at-least-as-strong certainty. In that case the consequent holds
on both paths whenever the guard matches, so firing the holder later is
sound and the holder can survive the merge alongside the vacuous-guard
rescue.
Closes phpstan/phpstan#9628
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CGhnJQpUWRRpg6H5LuWJkA1 parent f0b92e1 commit 7c82673
2 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4504 | 4504 | | |
4505 | 4505 | | |
4506 | 4506 | | |
| 4507 | + | |
| 4508 | + | |
| 4509 | + | |
| 4510 | + | |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
4507 | 4515 | | |
4508 | 4516 | | |
4509 | 4517 | | |
| |||
4536 | 4544 | | |
4537 | 4545 | | |
4538 | 4546 | | |
4539 | | - | |
| 4547 | + | |
4540 | 4548 | | |
4541 | 4549 | | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
4542 | 4563 | | |
4543 | 4564 | | |
4544 | 4565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments