Guidelines for the Type checker. A construct is well typed if it can be given a type. Every construct of your program should be well typed. Every expression has a type "int", "int[]", "String" or "boolean". Every method call has type the return type of the method, as long as each actual parameter matches the declared type of the formal parameter. Every statment has type "void", except for return statments, which have the type of the expression being returned. Variable declarations should also be given the "void" type. Unlike C, a statement cannot double as an expression (there's no i++, i-- in Minijava+). Every method must always return a type consitstent with its declared return type. Thus when checking the body of a method you must make that each return statement returns a expression of the approiate type (not just any well-typed expression). If the declared return type is void, then there cannot be any return statements ("return;" is not valid in Minijava+). If the declared returned type is not void, then no branch can terminate without return. For example int f(int y) { printf("%d",y); ... if (y<0) return y-1; else if (y%2==0) return y+1; else System.out.printf("odd"); } should not type check because the return type of the last else-branch is "void", not "int".