private boolean binaryTypeCheck(BinaryExpression expr, Class<?> clazz) {
            Expression left = expr.getLeftExpression();
            Expression right = expr.getRightExpression();

            Type leftType = left.getType();
            Type rightType = right.getType();

            if (leftType == null || rightType == null) {
                return false;
            }

            if (!clazz.isAssignableFrom(leftType.getObjectClass())) {
                if (!clazz.isAssignableFrom(rightType.getObjectClass())) {
                    String name = new Type(clazz).getSimpleName();
                    error("binaryexpression.type.both",
                          expr.getOperator().getImage(), name, expr);
                }
                else {
                    String name = new Type(clazz).getSimpleName();
                    error("binaryexpression.type.left",
                          expr.getOperator().getImage(), name, left);
                }
            }
            else if (!clazz.isAssignableFrom(rightType.getObjectClass())) {
                String name = new Type(clazz).getSimpleName();
                error("binaryexpression.type.right",
                      expr.getOperator().getImage(), name, right);
            }
            else {
                return true;
            }

            return false;
        }