[svn] r7045: nemerle/trunk/ncc: testsuite/positive/operators.n typing/Typer-DelayedTyping.n

malekith svnadmin at nemerle.org
Mon Dec 4 18:03:52 CET 2006


Log:
Don't try to look for operators other than !=/== in System.Object. Resolves #693.

Author: malekith
Date: Mon Dec  4 18:03:51 2006
New Revision: 7045

Modified:
   nemerle/trunk/ncc/testsuite/positive/operators.n
   nemerle/trunk/ncc/typing/Typer-DelayedTyping.n

Modified: nemerle/trunk/ncc/testsuite/positive/operators.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/operators.n	(original)
+++ nemerle/trunk/ncc/testsuite/positive/operators.n	Mon Dec  4 18:03:51 2006
@@ -255,6 +255,19 @@
     Operators.bug781();
 
     Bug415.Ax().Foo();
+
+    // bug #693
+    {
+      def quicksort(l)
+      {
+          | [] => []
+          | x :: xs =>
+              quicksort($[y | y in xs, y<x])
+              + [x]
+              + quicksort($[y | y in xs, y>=x])
+      }
+      System.Console.WriteLine(quicksort([2,1,3]));
+    }
   }
 }
 

Modified: nemerle/trunk/ncc/typing/Typer-DelayedTyping.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer-DelayedTyping.n	(original)
+++ nemerle/trunk/ncc/typing/Typer-DelayedTyping.n	Mon Dec  4 18:03:51 2006
@@ -551,6 +551,16 @@
           None ()
         else {
           match (t.AnyHint) {
+            // This is kind of ugly special case, we sometimes claim, the
+            // lower bound is System.Object in cases we don't really 
+            // think this will be the final type. 
+            // Therefore, for operators, that cannot be found in System.Object,
+            // don't even try. The ugly part, is that it won't work for ==/!=
+            | Some (Class (tc, []))
+              when tc.Equals (InternalType.Object_tc) && 
+                   name != "op_Equality" && name != "op_Inequality" => 
+              None ()
+            
             | Some (MType.Class as bound) =>
               Some (LookupOperatorIn (bound, name))
               



More information about the svn mailing list