Male, Christopher John2012-02-152022-11-012012-02-152022-11-0120092009https://ir.wgtn.ac.nz/handle/123456789/27709Static typing allows type errors to be revealed at compile time, which reduces the amount of maintenance and debugging that must occur later on. However, often the static type information included in source code is duplicate or redundant. Type inference resolves this issue by inferring the types of variables from their usage, allowing much of the type information to be omitted. This thesis formally describes Mocha, an extension to Java, which supports the inference of both local variable and field types. Mocha has unique support for local variables having different types at different program points which allows variables to be retyped due to certain conditional statements. It also includes a procedure for handling the effect Java exceptions have on the type inference process.pdfen-NZComputer programmingInferenceProgramming languagesMocha: type inference for JavaText