20 using System.Collections.Generic;
23 using ErrorManagement;
24 using TypeSystem.Operations;
26 namespace TypeSystem.Constraints {
50 get {
return this.secondOperand; }
57 public object Operator {
58 get {
return this.op; }
72 : base(firstOperand, location) {
73 this.secondOperand = secondOperand;
83 : this(firstOperand, secondOperand, null, location) { }
86 #region BuildTypeExpressionString()
88 return String.Format(
"{0} <= {1}", this.FirstOperand.FullName, this.SecondOperand.FullName);
92 #region EqualsAndGetHashCode
93 public override bool Equals(
object obj) {
95 if (constraint == null)
97 return this.FirstOperand.Equals(constraint.FirstOperand) && this.secondOperand.
Equals(constraint.secondOperand);
100 return this.FirstOperand.GetHashCode()*this.secondOperand.GetHashCode();
105 #region CloneTypeVariables()
106 public override Constraint CloneTypeVariables(IDictionary<TypeVariable, TypeVariable> typeVariableMappings, IList<EquivalenceClass> equivalenceClasses) {
115 TypeExpression newFirstOperand = this.FirstOperand.CloneTypeVariables(typeVariableMappings, equivalenceClasses,
new List<ClassType>()),
116 newSecondOperand = this.SecondOperand.CloneTypeVariables(typeVariableMappings, equivalenceClasses,
new List<ClassType>());
142 if (result == null && showInvocationMessage) {
147 return this.SecondOperand;
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.
Representa a method type.
virtual object AcceptOperation(TypeSystemOperation op, object arg)