Inference/src/TypeSystem/Operations/AssignmentOperation.cs
/// <summary>
/// Performs an assigment operation between a Class type and the typeExpression stored in this.rightOperand.
/// The type to asign to the array must be promotable to an ClassType, and the only allowable operator is AssignmentOperator
/// </summary>
/// <param name="leftOperand">The left operand of the assignmet operator.</param>
/// <returns>A type expression one all checks and promotions are tried to make the assignment right.</returns>
Performs an assigment operation between a Class type and the typeExpression stored in this.rightOperand.
The type to asign to the array must be promotable to an ClassType, and the only allowable operator is AssignmentOperator
Performs an assigment operation between a Class type and the typeExpression stored in this . rightOperand . The type to asign to the array must be promotable to an ClassType and the only allowable operator is AssignmentOperator
public override object Exec(ClassType leftOperand, object arg) { 
            if (this.op == AssignmentOperator.Assign) {
                if ( this.rightOperand.AcceptOperation(PromotionOperation.Create(leftOperand, this.op, this.methodAnalyzed, this.location), arg) == null )
                    return null;
                if (!leftOperand.HasTypeVariables())
                    return leftOperand;
                FieldType fieldType = TypeExpression.As<FieldType>(this.rightOperand);
                if (fieldType != null)
                    this.rightOperand = fieldType.FieldTypeExpression;
                if (leftOperand.Unify(this.rightOperand, this.unification, new List<Pair<TypeExpression, TypeExpression>>())) {
                    leftOperand.ValidTypeExpression = false;
                    return leftOperand;
                }
            }
            ErrorManager.Instance.NotifyError(new OperationNotAllowedError(this.op.ToString(), leftOperand.FullName, rightOperand.FullName, this.location));
            return null;
        }
public override object Exec ( ClassType leftOperand , object arg ) { if ( this . op == AssignmentOperator . Assign ) { if ( this . rightOperand . AcceptOperation ( PromotionOperation . Create ( leftOperand , this . op , this . methodAnalyzed , this . location ) , arg ) == null ) return null ; if ( ! leftOperand . HasTypeVariables ( ) ) return leftOperand ; FieldType fieldType = TypeExpression . As < FieldType > ( this . rightOperand ) ; if ( fieldType != null ) this . rightOperand = fieldType . FieldTypeExpression ; if ( leftOperand . Unify ( this . rightOperand , this . unification , new List < Pair < TypeExpression , TypeExpression > > ( ) ) ) { leftOperand . ValidTypeExpression = false ; return leftOperand ; } } ErrorManager . Instance . NotifyError ( new OperationNotAllowedError ( this . op . ToString ( ) , leftOperand . FullName , rightOperand . FullName , this . location ) ) ; return null ; }
Performs an assigment operation between a Class type and the typeExpression stored in this.rightOperand.
Performs an assigment operation between a Class type and the typeExpression stored in this . rightOperand .
// the unique allowable operator // * If the left expression of the assignment has type variables,  //   we must return the concrete type (not the abstract one) // * Then whe unify the concrete types
A type expression one all checks and promotions are tried to make the assignment right.
A type expression one all checks and promotions are tried to make the assignment right .
leftOperand
ClassType
The left operand of the assignmet operator.
The left operand of the assignmet operator .
arg
object