21 using System.Collections.Generic;
25 using ErrorManagement;
27 using TypeSystem.Operations;
29 namespace TypeSystem.Constraints {
48 get {
return this.secondOperand; }
61 base(firstOperand, location) {
62 this.secondOperand = secondOperand;
72 : base(firstOperand, returnType, location) {
73 this.secondOperand = secondOperand;
77 #region BuildTypeExpressionString()
79 return String.Format(
"{0}:={1} [ {2} ]", this.ReturnType.FullName, this.FirstOperand.FullName, this.SecondOperand.FullName);
83 #region CloneTypeVariables()
84 public override Constraint CloneTypeVariables(IDictionary<TypeVariable, TypeVariable> typeVariableMappings, IList<EquivalenceClass> equivalenceClasses) {
93 TypeExpression newFirstOperand = this.FirstOperand.CloneTypeVariables(typeVariableMappings, equivalenceClasses,
new List<ClassType>()),
94 newSecondOperand = this.SecondOperand.CloneTypeVariables(typeVariableMappings, equivalenceClasses,
new List<ClassType>());
114 if (result == null && showInvocationMessage) {
119 this.ReturnType.Unify(result, SortOfUnification.Equivalent,
new List<Pair<TypeExpression, TypeExpression>>());
120 this.ReturnType.ValidTypeExpression = this.ValidTypeExpression =
false;
121 return this.ReturnType;
override string BuildTypeExpressionString()
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.
Abstract class that represents all different types.
Represents a generic type expression
Implements bracket operation of a type expression. Implments double dispatcher pattern.
Representa a method type.
It represents constraints of the form: ret := ret := op1 [ op2 ]
virtual object AcceptOperation(TypeSystemOperation op, object arg)