21 using System.Collections.Generic;
25 using ErrorManagement;
27 using TypeSystem.Operations;
29 namespace TypeSystem.Constraints {
37 private string memberName;
44 public string MemberName {
48 get {
return this.memberName; }
61 : base(firstOperand, location) {
62 this.memberName = memberName;
71 : base(firstOperand, returnType, location) {
72 this.memberName = memberName;
76 #region BuildTypeExpressionString()
78 return String.Format(
"{0}:={1}.{2}", this.ReturnType.FullName, this.FirstOperand.FullName, this.MemberName);
82 #region CloneTypeVariables()
83 public override Constraint CloneTypeVariables(IDictionary<TypeVariable, TypeVariable> typeVariableMappings, IList<EquivalenceClass> equivalenceClasses) {
92 TypeExpression newFirstOperand = this.FirstOperand.CloneTypeVariables(typeVariableMappings, equivalenceClasses,
new List<ClassType>());
112 if (result == null && showInvocationMessage) {
117 this.ReturnType.Unify(result, SortOfUnification.Equivalent,
new List<Pair<TypeExpression, TypeExpression>>());
118 this.ReturnType.ValidTypeExpression = this.ValidTypeExpression =
false;
119 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
Implements a factory method pattern. Virtual constructor. Role: factory Implements a double dispatche...
static DotOperation Create(string memberName, IList< TypeExpression > previousDot)
Representa a method type.
virtual object AcceptOperation(TypeSystemOperation op, object arg)
It represents constraints of the form: ret := op1 . memberName