Java compilers check that we have caught or declared all
possible checked exceptions and that we have not declared
any exceptions that can't be thrown.
How is this analysis done?
-
We can write down a type and effect system that checks that
an expressions' declared exceptions are correct.
-
Then we can try to turn the checking system on its head to
create an inference system that tells us which exceptions we
should declare. (We end up generating constraints and
solving them again.)