Exemple #1
0
        // This check is different to the one in the other numeric operators (OpLt/etc)
        // because we allow simple object comparison
        public override bool IsCompilable()
        {
            var left  = LeftOperand;
            var right = RightOperand;

            if (!left.IsCompilable() || !right.IsCompilable())
            {
                return(false);
            }

            var leftDesc  = left.ExitDescriptor;
            var rightDesc = right.ExitDescriptor;
            var dc        = DescriptorComparison.CheckNumericCompatibility(leftDesc, rightDesc, _leftActualDescriptor, _rightActualDescriptor);

            return(!dc.AreNumbers || dc.AreCompatible);
        }
Exemple #2
0
        protected virtual bool IsCompilableOperatorUsingNumerics()
        {
            var left  = LeftOperand;
            var right = RightOperand;

            if (!left.IsCompilable() || !right.IsCompilable())
            {
                return(false);
            }

            // Supported operand types for equals (at the moment)
            var leftDesc  = left.ExitDescriptor;
            var rightDesc = right.ExitDescriptor;
            var dc        = DescriptorComparison.CheckNumericCompatibility(leftDesc, rightDesc, _leftActualDescriptor, _rightActualDescriptor);

            return(dc.AreNumbers && dc.AreCompatible);
        }