[svn] r7614: nemerle/trunk/ncc/typing/MType.n
malekith
svnadmin at nemerle.org
Mon Apr 23 16:25:22 CEST 2007
Log:
Put some comments in there.
Author: malekith
Date: Mon Apr 23 16:25:21 2007
New Revision: 7614
Modified:
nemerle/trunk/ncc/typing/MType.n
Modified: nemerle/trunk/ncc/typing/MType.n
==============================================================================
--- nemerle/trunk/ncc/typing/MType.n (original)
+++ nemerle/trunk/ncc/typing/MType.n Mon Apr 23 16:25:21 2007
@@ -37,30 +37,55 @@
public variant MType : TyVar
{
#region Options
+ /* Represent a class type with given type parameters, like "string" or "list[int]". */
| Class {
tycon : TypeInfo;
args : list [TyVar];
}
+
+ /* In code like:
+ class Foo[T] {
+ bar : list[T];
+ }
+ The "T" in "list[T]" would be represented by a TyVarRef.
+ You can get StaticTyVar objects from the type builder of Foo class.
+ */
| TyVarRef {
tyvar : StaticTyVar;
}
+
+ /* Represent a function type "from -> to".
+ If the function takes more than one parameter, the "from" is a tuple. */
| Fun {
from : TyVar;
to : TyVar;
}
+
+ /* Represent a tuple, like "int * string * list[float]" */
| Tuple {
args : list [TyVar];
}
+
+ /* Represent an array type, rank refers to the number of dimensions. */
| Array {
t : TyVar;
rank : int;
}
+
+ /* These are used in signatures of functions taking ref/out parameter.
+ For example in:
+ foo (x : ref int) : void
+ the x has type "Ref(Class(InternalType.Int32_tc,[]))".
+ They are not used in function types though!
+ */
| Ref {
t : TyVar;
}
| Out {
t : TyVar;
}
+
+ /* Represent the unit type. */
| Void
/* Used when given value is required to have all the listed types.
More information about the svn
mailing list