3 using TypeSystem.Constraints;
4 namespace TypeSystem.Operations {
38 this.castType = castType;
39 this.methodAnalyzed = methodAnalyzed;
40 this.location = location;
44 #region (TypeExpression) --->castType
53 if (this.castType == null)
57 return ReportError(from);
61 #region (TypeVarible) --->castType
62 public override object Exec(
TypeVariable from,
object arg) {
73 return from.Substitution.AcceptOperation(
this, arg);
75 if (this.methodAnalyzed != null) {
78 this.methodAnalyzed.AddConstraint(constraint);
79 return constraint.ReturnType;
81 return ReportError(from);
85 #region (FieldType) --->castType
86 public override object Exec(FieldType from,
object arg) {
94 if (from.FieldTypeExpression != null)
95 return from.FieldTypeExpression.AcceptOperation(
this, arg);
107 ErrorManager.Instance.NotifyError(
new TypeCastError(from.
FullName,
this.castType.FullName,
this.location));
These clase implements cast operation over a type expression that is encapsulated in a message pass t...
It represents constraints of the form (op1)op2 (op2 might be converted int a op1) ...
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.
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
override object ReportError(TypeExpression from)
If showMessages is true it raises and error. It returns null
Abstract class that represents all different types.
Represents a generic type expression
virtual string FullName
Gets the full name of the type Note: WriteType expression is the longest recursive representation of ...
bool showErrorMessages
Indicates if an error message should be shown (used for dynamic types)
Location location
The location (file, line, column) of text being analysed
Representa a method type.
TypeExpression Substitution
Gets the substitution; null if it does not exist
MethodType methodAnalyzed
The method that is being analyzed when the operation is performed.
Represents a error produced when a type cast can not be applied to specified expressions.