Commit 9bbf9b8
Skip
`inferConstantType` built the exact result string from the explicit
`getValueTypes()` only — `implode(',', array{'a', 'b', ...<int,
string>})` inferred `'a,b'` even though the unsealed extras can append
further segments. That's an unsound constant fold.
Bail out of the constant fold when the input `isUnsealed()->yes()` and
fall through to the accessory-based result, which only keeps what's
provable (e.g. `non-falsy-string` when the separator is non-falsy and
the explicit prefix guarantees at least one separator).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>implode() constant-fold for unsealed constant arrays1 parent 839a3d6 commit 9bbf9b8
2 files changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
71 | 88 | | |
0 commit comments