Adjusts types compatibility for operations.
Exemplo n.º 1
0
        public Expression Equal(Expression arg1, Expression arg2, Token oper)
        {
            var type1 = arg1.Type;
            var type2 = arg2.Type;

            TypeAdapter.MakeTypesCompatible(arg1, arg2, out arg1, out arg2, oper.Type);
            Wall.Eq(arg1, arg2, type1, type2, oper);

            try
            {
                return(Expression.Equal(arg1, arg2));
            }
            catch
            {
                throw new ParseErrorException(MakeInvalidTypesError(oper, type1, type2), ExprString, oper.Location);
            }
        }