20 using System.Collections.Generic;
23 using ErrorManagement;
24 using TypeSystem.Operations;
26 namespace TypeSystem.Constraints {
45 get {
return this.castType; }
59 : base(firstOperand, loc) {
60 this.castType = castType;
64 #region BuildTypeExpressionString()
66 return String.Format(
"({0}){1}", this.CastType.FullName, this.FirstOperand.FullName);
70 #region EqualsAndGetHashCode
71 public override bool Equals(
object obj) {
73 if (constraint == null)
75 return this.FirstOperand.Equals(constraint.FirstOperand) && this.CastType.
Equals(constraint.
CastType);
78 return this.FirstOperand.GetHashCode()*this.CastType.GetHashCode();
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 newCastType = this.CastType.CloneTypeVariables(typeVariableMappings, equivalenceClasses,
new List<ClassType>());
112 if (result == null && showInvocationMessage) {
117 return this.CastType;
These clase implements cast operation over a type expression that is encapsulated in a message pass t...
override bool Equals(object obj)
Represents a error produced when a constraint has not been satisfied
It represents constraints of the form (op1)op2 (op2 might be converted int a op1) ...
override int GetHashCode()
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.
TypeExpression CastType
The cast type
Abstract class that represents all different types.
Representa a method type.
override string BuildTypeExpressionString()
virtual object AcceptOperation(TypeSystemOperation op, object arg)