Semantic Diff

#9210 Accept only @throws and @doesNotThrow in reanalyze

1 commit

f1a0476fbfd154aa10d9c0e18b9064d77712acc9..pr-9210

2de3f5502 · cknitt + Claude · Nov 03, 2026, 20:00 UTC

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].

modifiedReanalyze old annotation spellings

@raises(Not_found)let oldRaisesAnnotation = () => throw(Not_found)
reanalyze Exception Analysis
Before
After
no issue
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.