CSC362L01 2004S, Lab 9: Type Checking Admin: * Happy April Fools' day * Missing: Angela, Piper, Shihan (excused), Ananta (excused) Overview: * Goals of today's lab * Lab * Reflection What should/could the type checker check/do? (Types and variables) * Are variables declared? (Checked) * Are variables redeclared? (Checked) * Where are variables declared? [NO: Syntactic] * Are variables initialized? (Not yet checked) * Do operands to operations have the right types? (Partially checked) * Addition: int x int or real x real * Modulo: int x int * Etc. * Does the RHS of an assignment have the same type as the LHS (Checked) * We might have the type checker coerce types (Not done) What were the "significant bugs" in compound expressions? * "difine" is misseppelled [No] * / is not set to return real in all cases * typeCheck(1 < 3): Returns integer as a type * Permits true < false * Generally: Does not validate operands and use different return type (Incorrect assumption: The return type is the same as the parameter type)