janhaag/PSE2011 — Issue #46: Unneccessary code in TypeChecker
Author: ratefuchs
Created: 2012-02-28 13:40:33+00:00
State: open

There is code in the class TypeChecker.java that cannot be reached when type checking a parsed program:
Currently, array indices are checked whether they are integer expressions or not (in latter case, an IllegalTypeException would be thrown).
However, there are implicit checks whether the indices are within the allowed range, which forces them to be integer expression. So the explicit check in visit(ArrayRead), visit(ArrayAssignment) and visit(ArrayDeclaration) is redundant.