Repository navigation
Commit 7a30820
Write a shape's optional keys as optional into a general array's item shape
ArrayType::setExistingOffsetValueType() merged a written constant array
into the item shape all-or-nothing: once with every key required and once
with every optional key unset. A written shape whose optional keys can be
present independently (a nested `$a[$i][$j][$k]['x'] = ...` write in a loop)
then came out as `array{}|array{k1: T, ..., kN: T}`, which is unsound for
a value holding only some of the keys. Optional keys are now written as
optional: an existing key keeps its certainty and unions the value, a
missing one is added as optional.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DfQHLTyyoMfjfa4sXJCGa51 parent f530893 commit 7a30820
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| 431 | + | |
431 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
432 | 447 | | |
433 | 448 | | |
434 | 449 | | |
| |||
0 commit comments