22 using System.Collections.Generic;
26 using ErrorManagement;
28 using TypeSystem.Operations;
31 namespace TypeSystem.Constraints {
56 get {
return this.secondOperand; }
63 get {
return this.op; }
77 : base(firstOperand, location) {
78 this.secondOperand = secondOperand;
90 : base(firstOperand, returnType, location) {
91 this.secondOperand = secondOperand;
96 #region BuildTypeExpressionString()
98 return String.Format(
"{0}:={1} {2} {3}", this.ReturnType.FullName, this.FirstOperand.FullName, op.ToString(), this.SecondOperand.FullName);
102 #region CloneTypeVariables()
103 public override Constraint CloneTypeVariables(IDictionary<TypeVariable, TypeVariable> typeVariableMappings, IList<EquivalenceClass> equivalenceClasses) {
112 TypeExpression newFirstOperand = this.FirstOperand.CloneTypeVariables(typeVariableMappings, equivalenceClasses,
new List<ClassType>()),
113 newSecondOperand = this.SecondOperand.CloneTypeVariables(typeVariableMappings, equivalenceClasses,
new List<ClassType>());
131 if (result == null && showInvocationMessage) {
136 this.ReturnType.Unify(result, SortOfUnification.Equivalent,
new List<Pair<TypeExpression, TypeExpression>>());
137 this.ReturnType.ValidTypeExpression = this.ValidTypeExpression =
false;
138 return this.ReturnType;
override TypeExpression CloneTypeVariables(IDictionary< TypeVariable, TypeVariable > typeVariableMappings, IList< EquivalenceClass > equivalenceClasses, IList< ClassType > clonedClasses)
Method that clones each type variable of a type expression. Equivalence classes are not cloned (but i...
Represents a error produced when a constraint has not been satisfied
This class encapsulates a location in a specific file. Implements an Inmutable pattern. So it can be used in any context, that is his internal fields never change.
override string BuildTypeExpressionString()
Abstract class that represents all different types.
Represents a generic type expression
RelationalOperator
Relational binary operators
Representa a method type.
It represents constraints of the form: ret := op1 op op2 where op is an relational operator (== != >=...
virtual object AcceptOperation(TypeSystemOperation op, object arg)