[svn] r6117: nemerle/trunk: lib/internal.n
ncc/testsuite/positive/generics2.n
nazgul
svnadmin at nemerle.org
Sun Feb 12 13:57:05 CET 2006
Log:
Testcase for 'a : 'b
Author: nazgul
Date: Sun Feb 12 13:57:00 2006
New Revision: 6117
Modified:
nemerle/trunk/lib/internal.n
nemerle/trunk/ncc/testsuite/positive/generics2.n
Modified: nemerle/trunk/lib/internal.n
==============================================================================
--- nemerle/trunk/lib/internal.n (original)
+++ nemerle/trunk/lib/internal.n Sun Feb 12 13:57:00 2006
@@ -186,8 +186,7 @@
{
public class Identity ['a, 'b] : Builtins.Function ['a, 'b] where 'a : 'b
{
- // do not work :/
- //public static Instance : Identity ['a, 'b] = Identity.['a, 'b] ();
+ public static Instance : Identity ['a, 'b] = Identity ();
public override apply (x : 'a) : 'b {
x
Modified: nemerle/trunk/ncc/testsuite/positive/generics2.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/generics2.n (original)
+++ nemerle/trunk/ncc/testsuite/positive/generics2.n Sun Feb 12 13:57:00 2006
@@ -49,4 +49,22 @@
}
+class AunderB ['a, 'b] where 'a : 'b {
+ public static x : AunderB ['a, 'b] = AunderB();
+
+ public foo (_x : 'a, _y : 'b) : void {
+ System.Console.WriteLine ("{0} {1}", typeof ('a), typeof ('b));
+ }
+}
+
+AunderB.x.foo (1,1);
+AunderB.x.foo (A1(), A());
+
+
+/*
+BEGIN-OUTPUT
+System.Int32 System.Int32
+A1 A
+END-OUTPUT
+*/
\ No newline at end of file
More information about the svn
mailing list