Commit 77aedcd
Move list-contradiction
`unsetOffset` is a "what does this array look like after unsetting X?"
operation — its result is always still an array. The three identical
`elseif ($this->isList->yes() && $newIsList->no()) { return new NeverType(); }`
returns sprinkled through the three branches were subtraction semantics
leaking up from the only two callers that pass
`preserveListCertainty = true`: the `HasOffsetType` and `HasOffsetValueType`
arms of `tryRemove`.
Push that check up to its actual home in `tryRemove`. The unset branches
now consistently return the post-unset shape; `tryRemove` decides on its
own that "definitely-a-list minus a definitely-present key = empty set"
and returns `NeverType` for that one case. Behaviour is preserved (full
test suite green).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>NeverType out of unsetOffset into tryRemove
1 parent dfe0c76 commit 77aedcd
1 file changed
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
862 | | - | |
863 | | - | |
864 | 862 | | |
865 | 863 | | |
866 | 864 | | |
| |||
1744 | 1742 | | |
1745 | 1743 | | |
1746 | 1744 | | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
1753 | 1755 | | |
1754 | 1756 | | |
1755 | 1757 | | |
| |||
0 commit comments