LARA

Suppose we allow nested function definitions:

varDecl ::= type ID | method

Give a new set of type rules to type-check a program with nested function definitions.

When such a nested function definition occurs we have to type-check its body and we have to type check the statements in the scope of this definition.
We will thus add a typing rule for block statements. Its antecedent will be composed of one part treating the body of the function and another treating the statements in scope.

In pdf