Commit 23e86a2
committed
fix(devx): read the our-default slot in a
`check-error-code-casing`'s fifth recognizer (#10760) anchors on the POSITION
token — `code:` / `code?:` / `.code =` — so it reaches an `||`/`??` fallback
chain only where the chain sits AT the stamp site. The identical chain one
indirection earlier, in a local's initializer, matched nothing:
const code = parsed?.code || 'lower_thing'; // our authored default
err.code = code;
`const code =` is neither spelling, and a type annotation does not rescue it:
`const code: string = …` does match `code:`, but then the gap has to cross an
`=`, which that character class refuses on purpose.
Nothing else saw it either. `check:dispatcher-error-vocabulary` reaches the
local (`err.code = code` is its `codehelper`/`assignconst` shape) but its
`resolveConstant` reduction is ALL-OR-NOTHING by design (#9568): one runtime
limb reduces the whole chain to nothing, because half an expression's values
is a finding wrong in both directions at once. That bound is deliberate and is
untouched here — its verdict line is byte-identical before and after.
So the literal half is this gate's, on exactly the reasoning #10760 published
for the stamp site: the capture is still only ever a STRING LITERAL, and a
literal in our source is by construction the default WE author. Where we write
the chain does not change whose default it is; the asymmetry was an artifact of
where the recognizer anchored, not a decision anyone took.
Adds a sixth recognizer, `local-fallback`, with the annotation gap spelled
`[^=;\n]` (the same spelling `classfield` uses in the sibling gate) and the
fifth pattern's own gap class and tail verbatim. The delegation runs the OTHER
way for an ALL-literal initializer — a bare literal, a ternary, a chain — which
IS reducible and stays the dispatcher gate's site under `assignconst`,
lowercase included; the quote refusal keeps this pattern off those, so one
literal never gets two reporters.
Also updates the three delegation enumerations in
`check-dispatcher-error-vocabulary.mjs` that #10762 had just corrected: they
recorded this position as owned by NOBODY and named #10897 as the open half.
Comment-only there; 8 shapes + 102 assertions and the full-run verdict all
unchanged.
Fixes #10897
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_c970724d-303c-5614-9d20-a3f92205cfadcode local's initializer too1 parent 58563be commit 23e86a2
2 files changed
Lines changed: 112 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
| |||
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
| |||
824 | 836 | | |
825 | 837 | | |
826 | 838 | | |
827 | | - | |
| 839 | + | |
828 | 840 | | |
829 | 841 | | |
830 | | - | |
831 | | - | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
832 | 846 | | |
833 | 847 | | |
834 | 848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
145 | 197 | | |
146 | 198 | | |
147 | 199 | | |
| |||
290 | 342 | | |
291 | 343 | | |
292 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
293 | 376 | | |
294 | 377 | | |
295 | 378 | | |
| |||
0 commit comments