2 using System.Collections.Generic;
3 using TypeSystem.Constraints;
4 using DynVarManagement;
5 namespace TypeSystem.Operations {
22 this.actualImplicitObject = actualImplicitObject;
23 this.arguments = arguments;
24 this.methodAnalyzed = methodAnalyzed;
25 this.activeSortOfUnification = activeSortOfUnification;
26 this.location = location;
30 #region BCLClassType ()
34 caller.FindConstructor(this.location);
39 return caller.BaseClass.AcceptOperation(
this, arg);
49 return method.AcceptOperation(
this, arg);
53 #region ClassTypeProxy ()
55 return caller.RealType.AcceptOperation(
this, arg);
59 #region IntersectionType ()
61 TypeExpression method = caller.overloadResolution(this.arguments, this.location);
64 return method.AcceptOperation(
this, arg);
71 if (this.arguments == null)
76 this.methodAnalyzed.MemberInfo.Modifiers.Contains(
Modifier.Static) && this.actualImplicitObject == null) {
83 return MethodType.methodCall(this.actualImplicitObject, caller, this.arguments, this.methodAnalyzed,this.activeSortOfUnification, this.location);
86 if (this.arguments.GetLength(0) != caller.ParameterListCount) {
87 ErrorManager.Instance.NotifyError(
new ArgumentNumberError(caller.MemberInfo.MemberIdentifier,
this.arguments.GetLength(0), this.location));
91 for (
int i = 0; i < caller.ParameterListCount; i++)
92 this.arguments[i].AcceptOperation(
PromotionOperation.
Create(caller.getParam(i), this.methodAnalyzed, this.location), arg);
99 #region TypeVariable ()
102 DynVarOptions.Instance.AssignDynamism(caller.Substitution, caller.IsDynamic);
103 return caller.Substitution.AcceptOperation(
this, arg);
105 if (this.methodAnalyzed != null) {
108 this.methodAnalyzed.AddConstraint(constraint);
109 return constraint.ReturnType;
111 return ReportError(caller);
121 this.methodAnalyzed.AddConstraint(constraint);
122 return constraint.ReturnType;
129 returnType = UnionType.collect(returnType, ret);
override object Exec(UnionType caller, object arg)
Represents a error produced when tries to make an operation not allowed for the specified type...
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...
string Name
Class identifier;
Represents a error produced when an instance method is called from a static one, whithout using an ob...
It represents constraints of the form: ret := op1(implicitObj, param*) where op1 is a method...
Represents a error produced when the argument and parameter number is different.
override object ReportError(TypeExpression caller)
AccessModifier MemberInfo
Gets or sets the attribute information of method type
override bool HasTypeVariables()
To know if the type expression has some type variables and requieres unification The default implemen...
Abstract class that represents all different types.
Represents a generic type expression
Represents a proxy of a class type. It implements the unfold operatations of theoretical type systes...
virtual string FullName
Gets the full name of the type Note: WriteType expression is the longest recursive representation of ...
ParenthesisOperation(TypeExpression actualImplicitObject, TypeExpression[] arguments, MethodType methodAnalyzed, SortOfUnification activeSortOfUnification, Location location)
Implements a factory method pattern. Virtual constructor. Role: factory Implements a double dispatche...
override object Exec(ClassType caller, object arg)
static DotOperation Create(string memberName, IList< TypeExpression > previousDot)
override object Exec(IntersectionType caller, object arg)
AccessModifier Constructors
Gets the constructor list
virtual bool IsDynamic
Indicates if the type has been set as dynamic
override object Exec(TypeVariable caller, object arg)
Modifier
Indicates differents modifiers to use in class (only public, internal or static), fields or methods...
Implements Double Dispatch Pattern Role:
override bool IsFreshVariable()
To know if it is a type variable with no substitution
UserType Class
Gets or sets the class type reference
Representa a method type.
override object Exec(BCLClassType caller, object arg)
List< Modifier > Modifiers
Gets the modifiers of the element
TypeExpression Substitution
Gets the substitution; null if it does not exist
override object Exec(ClassTypeProxy caller, object arg)
override object Exec(MethodType caller, object arg)
override object AcceptOperation(TypeSystemOperation op, object arg)
Representa an intersection type.
virtual object AcceptOperation(TypeSystemOperation op, object arg)