[svn] r7062: nemerle/trunk/ncc/testsuite/positive/infer.n

nazgul svnadmin at nemerle.org
Wed Dec 6 18:39:00 CET 2006


Log:
Add testcase for bug 552

Author: nazgul
Date: Wed Dec  6 18:38:57 2006
New Revision: 7062

Modified:
   nemerle/trunk/ncc/testsuite/positive/infer.n

Modified: nemerle/trunk/ncc/testsuite/positive/infer.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/infer.n	(original)
+++ nemerle/trunk/ncc/testsuite/positive/infer.n	Wed Dec  6 18:38:57 2006
@@ -40,6 +40,7 @@
     def _ = [ ([["foo"]], "foo") ] : list[_];
     System.Console.WriteLine (Set[int].A.B.x.GetType ());
     Bug527.Run ();
+    Bug552.Run ();
   }
 }
 
@@ -196,11 +197,41 @@
     }
 }
 
+public class Bug552 {
+   public static Run () : void   {
+     def quick (xs )
+     {
+       def quicker (xs, ys)
+       {
+         | ([],_ )=> ys
+         | ([x],_) => x::ys
+         | (a::bs,_) => 
+           def part(left, right, x)
+           {
+             | (l,r, []) => quicker (l, a::quicker(r, ys))
+             | (l,r, x::xs) => if (x<a) part(x::l, r, xs) else part (l,x::r,xs)
+           }
+           part([],[],bs)
+       }
+       quicker (xs, [])
+     }
+     
+     def pr(xs)
+     {
+       | [] => Nemerle.IO.printf("\n");
+       | x::xs => Nemerle.IO.printf("%i",x); pr(xs);
+     }
+     
+     pr(quick([1,8,2,3,4,7]));
+   }
+}
+
 
 /*
 BEGIN-OUTPUT
 M+Set`1+A[System.Int32]
 Bug527+LinkedList`1+Node[System.Int32]
 Bug527+LinkedList`1+Node[Bug527+LinkedList`1[System.Int32]]
+123478
 END-OUTPUT
 */



More information about the svn mailing list