@Override public Boolean visit(Pos exp) { Expr unExpr = exp.getExpr(); if (!(unExpr.typeOf(environment) == new IntType())) { errorMsgs.add(String.format("Pos expression is not numeric: %s", exp)); return false; } return unExpr.accept(this); }