[svn] r6245: nemerle/trunk: lib/internal-numbered.n
macros/operators.n misc/gen-func.n ncc/external/Intern...
malekith
svnadmin at nemerle.org
Sun May 7 20:41:20 CEST 2006
Log:
Increase maximal number of function type parameters to 20. Print a proper error message in case it is exceeded (#598). Use by-ref types (managed pointers) for caching of struct values, resolves #338. Allow casting from generic types (#503).
Author: malekith
Date: Sun May 7 20:41:14 2006
New Revision: 6245
Added:
nemerle/trunk/ncc/testsuite/negative/fun-parm-count.n
Modified:
nemerle/trunk/lib/internal-numbered.n
nemerle/trunk/macros/operators.n
nemerle/trunk/misc/gen-func.n
nemerle/trunk/ncc/external/InternalTypes.n
nemerle/trunk/ncc/generation/ILEmitter.n
nemerle/trunk/ncc/generation/Typer4.n
nemerle/trunk/ncc/testsuite/positive/struct.n
nemerle/trunk/ncc/testsuite/positive/valuetype-conv.n
nemerle/trunk/ncc/typing/LocalValue.n
nemerle/trunk/ncc/typing/Typer-PatternTyper.n
nemerle/trunk/ncc/typing/Typer.n
Modified: nemerle/trunk/lib/internal-numbered.n
==============================================================================
--- nemerle/trunk/lib/internal-numbered.n (original)
+++ nemerle/trunk/lib/internal-numbered.n Sun May 7 20:41:14 2006
@@ -32,6 +32,7 @@
// is also needed in MType.IsValueType
namespace Nemerle.Builtins {
+
public abstract class Function ['r] : Function [System.Object, 'r]
{
public abstract apply () : 'r;
@@ -140,7 +141,7 @@
public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5) : void;
- public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4);}
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4); }
}
@@ -255,7 +256,7 @@
public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8) }
}
-public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7,'p8, 'p9]]
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]]
{
public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9) : void;
public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8); }
@@ -280,4 +281,423 @@
public field7 : 'p7;
public field8 : 'p8;
}
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ public field12 : 'p12;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ public field12 : 'p12;
+ public field13 : 'p13;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ public field12 : 'p12;
+ public field13 : 'p13;
+ public field14 : 'p14;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ public field12 : 'p12;
+ public field13 : 'p13;
+ public field14 : 'p14;
+ public field15 : 'p15;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16, _ : 'p17) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15, o.field16) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16, _ : 'p17) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15, o.field16); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ public field12 : 'p12;
+ public field13 : 'p13;
+ public field14 : 'p14;
+ public field15 : 'p15;
+ public field16 : 'p16;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16, _ : 'p17, _ : 'p18) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15, o.field16, o.field17) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16, _ : 'p17, _ : 'p18) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15, o.field16, o.field17); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ public field12 : 'p12;
+ public field13 : 'p13;
+ public field14 : 'p14;
+ public field15 : 'p15;
+ public field16 : 'p16;
+ public field17 : 'p17;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16, _ : 'p17, _ : 'p18, _ : 'p19) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15, o.field16, o.field17, o.field18) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16, _ : 'p17, _ : 'p18, _ : 'p19) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15, o.field16, o.field17, o.field18); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ public field12 : 'p12;
+ public field13 : 'p13;
+ public field14 : 'p14;
+ public field15 : 'p15;
+ public field16 : 'p16;
+ public field17 : 'p17;
+ public field18 : 'p18;
+ }
+
+public abstract class Function ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'p20, 'r] : Function [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'p20], 'r]
+{
+ public abstract apply (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16, _ : 'p17, _ : 'p18, _ : 'p19, _ : 'p20) : 'r;
+ public override apply (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'p20]) : 'r { apply (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15, o.field16, o.field17, o.field18, o.field19) }
+}
+
+public abstract class FunctionVoid ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'p20] : FunctionVoid [Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'p20]]
+{
+ public abstract apply_void (_ : 'p1, _ : 'p2, _ : 'p3, _ : 'p4, _ : 'p5, _ : 'p6, _ : 'p7, _ : 'p8, _ : 'p9, _ : 'p10, _ : 'p11, _ : 'p12, _ : 'p13, _ : 'p14, _ : 'p15, _ : 'p16, _ : 'p17, _ : 'p18, _ : 'p19, _ : 'p20) : void;
+ public override apply_void (o : Tuple ['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'p20]) : void { apply_void (o.field0, o.field1, o.field2, o.field3, o.field4, o.field5, o.field6, o.field7, o.field8, o.field9, o.field10, o.field11, o.field12, o.field13, o.field14, o.field15, o.field16, o.field17, o.field18, o.field19); }
+}
+
+
+ [System.Serializable,
+ Record,
+ StructuralEquality,
+ TupleToString,
+ StructuralHashCode,
+ DisableImplicitConstructor]
+ public sealed class Tuple ['p0, 'p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19]
+ {
+ public field0 : 'p0;
+ public field1 : 'p1;
+ public field2 : 'p2;
+ public field3 : 'p3;
+ public field4 : 'p4;
+ public field5 : 'p5;
+ public field6 : 'p6;
+ public field7 : 'p7;
+ public field8 : 'p8;
+ public field9 : 'p9;
+ public field10 : 'p10;
+ public field11 : 'p11;
+ public field12 : 'p12;
+ public field13 : 'p13;
+ public field14 : 'p14;
+ public field15 : 'p15;
+ public field16 : 'p16;
+ public field17 : 'p17;
+ public field18 : 'p18;
+ public field19 : 'p19;
+ }
+
}
Modified: nemerle/trunk/macros/operators.n
==============================================================================
--- nemerle/trunk/macros/operators.n (original)
+++ nemerle/trunk/macros/operators.n Sun May 7 20:41:14 2006
@@ -56,7 +56,7 @@
{
match (e) {
| <[ $obj.$mem ]> when !Macros.IsTypeName (obj) =>
- (<[ def tmp = $obj ]>, <[ tmp.$mem ]>)
+ (<[ _N_ref_cache (tmp, $obj) ]>, <[ tmp.$mem ]>)
| <[ $obj . $mem [.. $idxes] ]> when !Macros.IsTypeName (obj) =>
def (cache, idx_exprs) = cache_indices (obj, idxes);
Modified: nemerle/trunk/misc/gen-func.n
==============================================================================
--- nemerle/trunk/misc/gen-func.n (original)
+++ nemerle/trunk/misc/gen-func.n Sun May 7 20:41:14 2006
@@ -103,7 +103,7 @@
}
}
-for (mutable i = 0; i < 10; ++i)
+for (mutable i = 0; i < 21; ++i)
gen (true, i);
print ("}\n");
Modified: nemerle/trunk/ncc/external/InternalTypes.n
==============================================================================
--- nemerle/trunk/ncc/external/InternalTypes.n (original)
+++ nemerle/trunk/ncc/external/InternalTypes.n Sun May 7 20:41:14 2006
@@ -484,6 +484,9 @@
public GetFunctionType (len : int) : FunctionType
{
+ when (function_types.Length <= len)
+ Message.FatalError ($ "function types only up to $(function_types.Length) "
+ "parameters are supported, sorry (got $len)");
when (function_types [len] == null)
function_types [len] = FunctionType (len);
@@ -492,6 +495,9 @@
public GetTupleType (len : int) : TupleType
{
+ when (tuple_types.Length <= len)
+ Message.FatalError ($ "tuple types only up to $(tuple_types.Length) "
+ "parameters are supported, sorry (got $len)");
when (tuple_types [len] == null)
tuple_types [len] = TupleType (len);
Modified: nemerle/trunk/ncc/generation/ILEmitter.n
==============================================================================
--- nemerle/trunk/ncc/generation/ILEmitter.n (original)
+++ nemerle/trunk/ncc/generation/ILEmitter.n Sun May 7 20:41:14 2006
@@ -228,7 +228,7 @@
/** Box the value of type [t] if needed. */
need_reference (t : System.Type) : void
{
- when (t.IsValueType)
+ when (t.IsValueType || t.IsGenericParameter)
_ilg.Emit (OpCodes.Box, t);
}
@@ -765,12 +765,20 @@
def type_of_expr = val.SystemType;
def cast_to_stype = cast_to_type.SystemType;
+ def is_generic =
+ if (type_of_expr.IsGenericParameter) {
+ _ilg.Emit (OpCodes.Box, type_of_expr);
+ true
+ } else false;
+
if (type_of_expr.IsValueType) {
/* perform conversion of value types */
emit_value_type_conversion (expr.loc, val.Type, cast_to_type, is_checked)
}
- else if (SystemType.Object : object == type_of_expr || type_of_expr.IsInterface
- || (SystemType.Enum : object == type_of_expr && cast_to_stype.IsEnum)) {
+ else if (is_generic ||
+ SystemType.Object : object == type_of_expr ||
+ type_of_expr.IsInterface ||
+ (SystemType.Enum : object == type_of_expr && cast_to_stype.IsEnum)) {
/* unboxing returns a pointer to a value */
_ilg.Emit (OpCodes.Unbox, cast_to_stype);
@@ -1429,7 +1437,7 @@
}
}
} else {
- if (get_address_for_value_types)
+ if (get_address_for_value_types && !decl.IsManagedPtr)
_ilg.Emit (OpCodes.Ldloca, decl.LocalSlot)
else
_ilg.Emit (OpCodes.Ldloc, decl.LocalSlot)
@@ -1756,7 +1764,12 @@
{
when (Options.EmitDebug) _ilg.BeginScope ();
- def local_slot = _ilg.DeclareLocal (val.Type.SystemType);
+ def ty =
+ if (val.IsManagedPtr)
+ val.Type.SystemType.MakeByRefType ()
+ else val.Type.SystemType;
+
+ def local_slot = _ilg.DeclareLocal (ty);
when (Options.EmitDebug) local_slot.SetLocalSymInfo (val.Name);
val.LocalSlot = local_slot;
local_slot
Modified: nemerle/trunk/ncc/generation/Typer4.n
==============================================================================
--- nemerle/trunk/ncc/generation/Typer4.n (original)
+++ nemerle/trunk/ncc/generation/Typer4.n Sun May 7 20:41:14 2006
@@ -509,7 +509,11 @@
| DefValIn (decl, e1, e2) =>
def e1 = Walk (e1);
def e2 = Walk (e2);
- if (NeedBoxing (decl.Type.Fix (), e1))
+ if (decl.IsCache && decl.Type.Fix ().IsValueType) {
+ e1.NeedAddress = true;
+ decl.IsManagedPtr = true;
+ TExpr.DefValIn (decl, e1, e2)
+ } else if (NeedBoxing (decl.Type.Fix (), e1))
TExpr.DefValIn (decl, Box (decl.Type.Fix (), e1), e2)
else
TExpr.DefValIn (decl, e1, e2)
Added: nemerle/trunk/ncc/testsuite/negative/fun-parm-count.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/negative/fun-parm-count.n Sun May 7 20:41:14 2006
@@ -0,0 +1,11 @@
+// bug 598
+def foo ( // E: function types only up to
+ _x1, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10,
+ _y1, _y2, _y3, _y4, _y5, _y6, _y7, _y8, _y9, _y10,
+ _z1, _z2, _z3, _z4, _z5, _z6, _z7, _z8, _z9, _z10)
+{
+}
+
+
+_ = foo;
+
Modified: nemerle/trunk/ncc/testsuite/positive/struct.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/struct.n (original)
+++ nemerle/trunk/ncc/testsuite/positive/struct.n Sun May 7 20:41:14 2006
@@ -1,4 +1,4 @@
-
+using System;
using Nemerle.IO;
// ------------ DEPENDANT STRUCTS ----------------
@@ -140,6 +140,37 @@
}
}
+struct S {
+ public mutable g : int;
+
+ public play () : void {
+ def x = this;
+ x.g = 10;
+ ++x.g;
+ assert (x.g == 11);
+ }
+}
+
+ [Record]
+ class some_struct // as in gdevdsp.h
+ {
+ size : int;
+ version_major : int;
+ version_minor : int;
+
+ display_open : IntPtr * IntPtr -> int;
+ display_preclose : IntPtr * IntPtr -> int;
+ display_close : IntPtr * IntPtr -> int;
+
+ display_presize : IntPtr * IntPtr * int * int * int * uint -> int;
+ display_size : IntPtr * IntPtr * int * int * int * uint * IntPtr -> int;
+ display_sync : IntPtr * IntPtr -> int;
+ display_page : IntPtr * IntPtr * int * int -> int;
+ display_update : IntPtr * IntPtr * int * int * int * int -> int;
+ display_memalloc: IntPtr * IntPtr * ulong -> IntPtr;
+ display_memfree : IntPtr * IntPtr * IntPtr -> int;
+ }
+
public module Test
{
test_passing_around (s : TestStruct) : void
@@ -178,6 +209,19 @@
NestedValueType.Run ();
assert (ar [0].Get () == "19");
+
+ // bug 338
+ def x = S();
+ x.play ();
+
+ def a = S ();
+ def b = S ();
+ a.g = 1; b.g = 2;
+ a.g <-> b.g;
+ assert (b.g == 1 && a.g == 2);
+
+ // bug 598
+ _ = some_struct;
}
}
Modified: nemerle/trunk/ncc/testsuite/positive/valuetype-conv.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/valuetype-conv.n (original)
+++ nemerle/trunk/ncc/testsuite/positive/valuetype-conv.n Sun May 7 20:41:14 2006
@@ -37,6 +37,20 @@
f ( () );
f (g ());
+
+ // bug 503
+ def better_to_string ['a] (x : 'a) {
+ match (x) {
+ | str is string => "\"" + str + "\""
+ | ch is char => "'" + ch.ToString () + "'"
+ | _ => x.ToString ()
+ }
+ }
+
+
+ System.Console.WriteLine (better_to_string ("foo"));
+ System.Console.WriteLine (better_to_string ('f'));
+ System.Console.WriteLine (better_to_string (4));
}
}
@@ -55,5 +69,8 @@
f [System.Object] called
g called
f [System.Object] called
+"foo"
+'f'
+4
END-OUTPUT
*/
Modified: nemerle/trunk/ncc/typing/LocalValue.n
==============================================================================
--- nemerle/trunk/ncc/typing/LocalValue.n (original)
+++ nemerle/trunk/ncc/typing/LocalValue.n Sun May 7 20:41:14 2006
@@ -51,6 +51,10 @@
mutable in_closure : bool;
[Accessor (flags = WantSetter)]
mutable ever_used : bool;
+ [Accessor (flags = WantSetter)]
+ mutable is_cache : bool;
+ [Accessor (flags = WantSetter)]
+ mutable is_managed_ptr : bool;
mutable is_registered : bool;
mutable closure_field : IField;
Modified: nemerle/trunk/ncc/typing/Typer-PatternTyper.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer-PatternTyper.n (original)
+++ nemerle/trunk/ncc/typing/Typer-PatternTyper.n Sun May 7 20:41:14 2006
@@ -609,6 +609,8 @@
if (properly_subtypes) {
matched_value_type.ForceProvide (needed_type);
null
+ } else if (matched_value_type.Fix () is MType.TyVarRef) {
+ null
} else {
if (needed_type.IsInterface ||
Option.UnSome (matched_value_type.Hint).IsInterface) {
Modified: nemerle/trunk/ncc/typing/Typer.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer.n (original)
+++ nemerle/trunk/ncc/typing/Typer.n Sun May 7 20:41:14 2006
@@ -1377,6 +1377,14 @@
}
TypeExpr (loop (List.Rev (parms)), expected)
+ | <[ $("_N_ref_cache" : dyn) ($(name : name), $val) ]> =>
+ if (Expect (expected, InternalType.Void, "definition ``result''")) {
+ def res = TypeLocalDefinition (false, name, val);
+ res.name.IsCache = true;
+ res
+ } else
+ TExpr.Error ()
+
| PT.PExpr.Call (Ref (name = (idl = "_N_skip_write_check")), [parm]) =>
def e = TypeExpr (parm, expected);
e.SkipWriteCheck = true;
More information about the svn
mailing list