Commit 561ded3
Treat the
The empty-keys block unconditionally overrode `$isList` from the
unsealed key type, while the non-empty path only filled it in when
null — an asymmetry. No caller actually passes a non-null `$isList`
for an empty CAT, so the override and the only-when-null path were
equivalent today, but the rule was inconsistent on its face.
Wrap both branches in `if ($isList === null)` so the constructor
consistently says "trust the caller when given, infer from shape
otherwise". Also drop the stale `makeList()` TODO — the comment
was speculating about validation that would require `isList=Maybe`
co-occurring with a non-list-compatible shape, a state that no
source-level flow actually constructs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>isList-from-shape inference in ConstantArrayType symmetrically1 parent 36f8650 commit 561ded3
1 file changed
Lines changed: 18 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
154 | 155 | | |
155 | | - | |
156 | | - | |
157 | 156 | | |
158 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
159 | 165 | | |
| 166 | + | |
| 167 | + | |
160 | 168 | | |
161 | 169 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| |||
3053 | 3057 | | |
3054 | 3058 | | |
3055 | 3059 | | |
3056 | | - | |
3057 | | - | |
3058 | 3060 | | |
3059 | 3061 | | |
3060 | 3062 | | |
| |||
0 commit comments