No warning for methods declaring throws that do not throw
Submitted by Richard Schwarting
Link to original bug (#702832)
Description
Currently, if a method is declared as throwing an error, and a caller doesn't catch it, there's a warning.
However, if a method is declared as throwing an error, and never does throw an error, there's no warning.
For larger code bases, gradual changes in error handling can be hard to keep track of, and it would be nice to know if something should be throwing an error, but is not.
STEPS TO REPRODUCE
- Compile the following code:
public errordomain SomeError { FISH; } public static void go_fish () throws SomeError { } public static void main () { go_fish (); }
ACTUAL RESULTS: No warning that go_fish () doesn't actually throw an error.
EXPECTED RESULTS: A warning if go_fish never throws an error (and does not call a method that would, either).
Version: 0.18.x