Inference/src/TypeSystem/Constraints/FieldTypeVariableAssignmentConstraint.cs
/// <summary>
/// Checks the constraints of a attribute assigment in a method call
/// </summary>
/// <param name="methodAnalyzed">The method that is being analyzed when the operation is performed.</param>
/// <param name="actualImplicitObject">Only suitable in an assignment constraint. It represents the actual object used to pass the message.</param>
/// <param name="showInvocationMessage">To show the invocation line and column in case an error exists</param>
/// <param name="activeSortOfUnification">The active sort of unification used (Equivalent is the default
/// one and Incremental is used in the SSA bodies of the while, for and do statements)</param>
/// <param name="location">Location of the method call</param>
/// <returns>The return type expression</returns>
Checks the constraints of a attribute assigment in a method call
Checks the constraints of a attribute assigment in a method call
public override TypeExpression Check(MethodType methodAnalyzed, TypeExpression actualImplicitObject, bool showInvocationMessage,
            SortOfUnification activeSortOfUnification, Location location) {
            if (this.alpha.Substitution == null) {
                this.alpha.AcceptOperation(new AssignmentOperation(this.beta, AssignmentOperator.Assign, methodAnalyzed, this.sortOfUnification, actualImplicitObject, location), null);
                return this.alpha;
            }
            FieldType fieldType = this.alpha.Substitution as FieldType;
            if (fieldType == null) {
                ErrorManager.Instance.NotifyError(new UnknownMemberError(this.memberName, location));
                return null;
            }
            SortOfUnification unification = activeSortOfUnification==SortOfUnification.Incremental ? SortOfUnification.Incremental: this.sortOfUnification;
            fieldType.AcceptOperation(new AssignmentOperation(this.beta, AssignmentOperator.Assign, methodAnalyzed, unification, actualImplicitObject, location), null);
            return fieldType;
        }
public override TypeExpression Check ( MethodType methodAnalyzed , TypeExpression actualImplicitObject , bool showInvocationMessage , SortOfUnification activeSortOfUnification , Location location ) { if ( this . alpha . Substitution == null ) { this . alpha . AcceptOperation ( new AssignmentOperation ( this . beta , AssignmentOperator . Assign , methodAnalyzed , this . sortOfUnification , actualImplicitObject , location ) , null ) ; return this . alpha ; } FieldType fieldType = this . alpha . Substitution as FieldType ; if ( fieldType == null ) { ErrorManager . Instance . NotifyError ( new UnknownMemberError ( this . memberName , location ) ) ; return null ; } SortOfUnification unification = activeSortOfUnification == SortOfUnification . Incremental ? SortOfUnification . Incremental : this . sortOfUnification ; fieldType . AcceptOperation ( new AssignmentOperation ( this . beta , AssignmentOperator . Assign , methodAnalyzed , unification , actualImplicitObject , location ) , null ) ; return fieldType ; }
Checks the constraints of a attribute assigment in a method call
Checks the constraints of a attribute assigment in a method call
The return type expression
The return type expression
methodAnalyzed
MethodType
The method that is being analyzed when the operation is performed.
The method that is being analyzed when the operation is performed .
actualImplicitObject
TypeExpression
Only suitable in an assignment constraint. It represents the actual object used to pass the message.
Only suitable in an assignment constraint . It represents the actual object used to pass the message .
showInvocationMessage
bool
To show the invocation line and column in case an error exists
To show the invocation line and column in case an error exists
activeSortOfUnification
SortOfUnification
The active sort of unification used (Equivalent is the default
one and Incremental is used in the SSA bodies of the while, for and do statements)
The active sort of unification used ( Equivalent is the default one and Incremental is used in the SSA bodies of the while for and do statements )
location
Location
Location of the method call
Location of the method call