Repository navigation
Commit fd46de2
Accept only @throws and @doesNotThrow in reanalyze
Why:
12.0.0-beta.14 deprecated `@raises` and `@doesNotRaise` in favour of
`@throws` and `@doesNotThrow` (#7932). v13 drops the old spellings,
the undeprecated `@throw` synonym, and the `@doNotThrow`/case variants,
so one spelling remains for each annotation.
An old spelling is now an unknown attribute, so the code it annotated is
reported like unannotated code. The compiler's own `[@doesNotRaise]` and
`[@@raises]` annotations become `[@doesNotThrow]` and `[@@throws]`.
Reanalyze modified (old annotation spellings):
Example:
@raises(Not_found)
let oldRaisesAnnotation = () => throw(Not_found)
Before (reanalyze): no issue
After (reanalyze):
Exception Analysis
ExnOldSpellings.res:5:5-23
oldRaisesAnnotation might throw Not_found (ExnOldSpellings.res:5:32) and is not annotated with @throws(Not_found)
Review: Why no dedicated warning for an old spelling? The missing-annotation report already names the `@throws(...)` to write, and recognizing the old names only to reject them would keep them in the analysis.
Breaking: `@raises`, `@raise`, `@throw`, `@doesNotRaise`, `@doNotRaise`, `@doNotThrow` and the lower-case variants are ignored; write `@throws` and `@doesNotThrow`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gGhHjzBTXqSo8Dckpb
Signed-off-by: Christoph Knittel <ck@cca.io>1 parent 6741bab commit fd46de2
34 files changed
Lines changed: 137 additions & 120 deletions
File tree
- analysis
- reanalyze/src
- src
- changes
- compiler
- ext
- gentype
- ml
- syntax
- cli
- src
- tests/analysis_tests/tests-reanalyze/deadcode
- expected
- src/exception
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
836 | | - | |
| 836 | + | |
837 | 837 | | |
838 | 838 | | |
839 | | - | |
| 839 | + | |
840 | 840 | | |
841 | 841 | | |
842 | 842 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 316 | + | |
323 | 317 | | |
324 | 318 | | |
325 | 319 | | |
| |||
425 | 419 | | |
426 | 420 | | |
427 | 421 | | |
428 | | - | |
429 | | - | |
430 | | - | |
| 422 | + | |
431 | 423 | | |
432 | 424 | | |
433 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
| 110 | + | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 41 | | |
54 | 42 | | |
55 | 43 | | |
| |||
151 | 139 | | |
152 | 140 | | |
153 | 141 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | 142 | | |
166 | 143 | | |
167 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
0 commit comments