CSC362L01 2004S, Lab 9: Type Checking Admin: * Happy April Fools' day * Missing: Overview: * Goals of today's lab * Lab What should/could the type checker check? * Assigning a real value to an integer (assigning type a to type b) * Redefinition of a variable (or giving it two different types) * Both operands to an operator must have the same type * And recursively * How do we deal with overloaded function or procedure calls? Assume the return type is the same as the operand type? * (Casting) * Verify that the operator can be applied to its operands (e.g., + shouldn't be applied to boolean values; mod shouldn't applied to reals) * Types must be defined (as used in the declarations section) * Variables must be declared before being used * Variables must be initialized before being used