Give a finally block that always throws no unreachable-code warning
Why
The finally block is typed as a statement, and a statement of type 'a reports warning 21, although no code follows a throw that ends the finally block. Code that follows it inside the block still warns.
removedDiagnostic warning 21 for a throwing finally block
exception Blet k = () => try { 1 } finally { throw(B) }
diagnostic
Before
After
Warning number 212:35-42This statement does not continue execution; following code is unreachable.no warning
Review
- Does
{ throw(B); Console.log(2) }in a finally block still warn? Yes, the sequence typesthrow(B)as an ordinary statement.