CSC448: Code Generation Revisited: Type and Effect Analysis [130/133] Previous pageContentsNext page

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.

Oddly enough, we end up generating constraints and solving them again.

Previous pageContentsNext page