Inference/src/TypeSystem/Operations/BinaryArithmeticalOperation.cs
/// <summary>
/// These method is called passing firstOperand a left operand in a binary arithmetical operation.
/// The second operand is encapsulated as secondOperand, in every instances of the class.
/// The first Operand is a BoolType so the second must be promotable to an expression where a + or 
/// - made sense with a boolean value.
/// Implements a double dispatch pattern.
/// </summary>
/// <param name="firstOperand">The left operand of the operation is a BoolType.</param>
/// <returns>A TypeExpression if the operation makes sense, otherwise if showMessages is true, an error is raised</returns>
These method is called passing firstOperand a left operand in a binary arithmetical operation.
The second operand is encapsulated as secondOperand, in every instances of the class.
The first Operand is a BoolType so the second must be promotable to an expression where a + or
made sense with a boolean value.
Implements a double dispatch pattern.
These method is called passing firstOperand a left operand in a binary arithmetical operation . The second operand is encapsulated as secondOperand in every instances of the class . The first Operand is a BoolType so the second must be promotable to an expression where a + or made sense with a boolean value . Implements a double dispatch pattern .
public override object Exec(BoolType firstOperand, object arg) {
            if (this.binaryOperator.Equals(ArithmeticOperator.Plus) && (bool)this.secondOperand.AcceptOperation(new EquivalentOperation(StringType.Instance), arg))
                return StringType.Instance;
            if (this.showErrorMessage) 
                ErrorManager.Instance.NotifyError(new TypePromotionError(firstOperand.FullName, this.secondOperand.FullName, this.binaryOperator.ToString(), this.location));
            return null;
        }
public override object Exec ( BoolType firstOperand , object arg ) { if ( this . binaryOperator . Equals ( ArithmeticOperator . Plus ) && ( bool ) this . secondOperand . AcceptOperation ( new EquivalentOperation ( StringType . Instance ) , arg ) ) return StringType . Instance ; if ( this . showErrorMessage ) ErrorManager . Instance . NotifyError ( new TypePromotionError ( firstOperand . FullName , this . secondOperand . FullName , this . binaryOperator . ToString ( ) , this . location ) ) ; return null ; }
These method is called passing firstOperand a left operand in a binary arithmetical operation.
These method is called passing firstOperand a left operand in a binary arithmetical operation .
//TODO: REvisar ESta SIgnaTURA
A TypeExpression if the operation makes sense, otherwise if showMessages is true, an error is raised
A TypeExpression if the operation makes sense otherwise if showMessages is true an error is raised
firstOperand
BoolType
The left operand of the operation is a BoolType.
The left operand of the operation is a BoolType .
arg
object