[svn] r6153: nemerle/trunk/ncc: testsuite/negative/block1.n testsuite/negative/calling.n testsuite/negativ...

malekith svnadmin at nemerle.org
Sun Mar 5 17:42:30 CET 2006


Log:
Somewhat better messages for errors in calls.

Author: malekith
Date: Sun Mar  5 17:42:28 2006
New Revision: 6153

Modified:
   nemerle/trunk/ncc/testsuite/negative/block1.n
   nemerle/trunk/ncc/testsuite/negative/calling.n
   nemerle/trunk/ncc/testsuite/negative/cyclic-type.n
   nemerle/trunk/ncc/testsuite/negative/operators.n
   nemerle/trunk/ncc/testsuite/negative/tyenf.n
   nemerle/trunk/ncc/typing/Typer-CallTyper.n
   nemerle/trunk/ncc/typing/Typer-DelayedTyping.n
   nemerle/trunk/ncc/typing/Typer.n

Modified: nemerle/trunk/ncc/testsuite/negative/block1.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/block1.n	(original)
+++ nemerle/trunk/ncc/testsuite/negative/block1.n	Sun Mar  5 17:42:28 2006
@@ -35,7 +35,7 @@
       when (3 < 4)
         brk (42);
       when (3 < 5)
-        brk ("foo"); // E: in argument #1, needed a int.*, got string
+        brk ("foo"); // E: in argument #1 of brk, needed a int.*, got string
       "foo"
     }
   }

Modified: nemerle/trunk/ncc/testsuite/negative/calling.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/calling.n	(original)
+++ nemerle/trunk/ncc/testsuite/negative/calling.n	Sun Mar  5 17:42:28 2006
@@ -28,7 +28,7 @@
   {
     mutable x = BD (); // OK
     rq (x); // OK
-    qux (ref x); // E: in argument #1 \(_x\), needed a B, got BD
+    qux (ref x); // E: in argument #1 \(_x\) of M.qux, needed a B, got BD: the types B and BD are not compatible
   }
 
   static quxxxxx () : void

Modified: nemerle/trunk/ncc/testsuite/negative/cyclic-type.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/cyclic-type.n	(original)
+++ nemerle/trunk/ncc/testsuite/negative/cyclic-type.n	Sun Mar  5 17:42:28 2006
@@ -4,6 +4,6 @@
    public static Main () : void
    {
      def f (x) { x (x) }
-     f (3) // E: typing error in call
+     f (3) // E: in argument #1 \(x\) of f, needed
    }
 }

Modified: nemerle/trunk/ncc/testsuite/negative/operators.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/operators.n	(original)
+++ nemerle/trunk/ncc/testsuite/negative/operators.n	Sun Mar  5 17:42:28 2006
@@ -5,9 +5,9 @@
   class X {}
   Main () : void
   {
-    def _ = 1 * null; // E: in argument #2, needed a int, got.*null
-    def _ = "foo" + X(); // E: in argument #2 \(right\), needed a string, got M.X
-    def _ = X() + "foo"; // E: in argument #1 \(left\), needed a string, got M.X
+    def _ = 1 * null; // E: in argument #2.*, needed a int, got.*null
+    def _ = "foo" + X(); // E: in argument #2 \(right\).*, needed a string, got M.X
+    def _ = X() + "foo"; // E: in argument #1 \(left\).*, needed a string, got M.X
 
     def h = Hashtable (); // OK
     h [ "foo" ] = "bar"; // OK

Modified: nemerle/trunk/ncc/testsuite/negative/tyenf.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/tyenf.n	(original)
+++ nemerle/trunk/ncc/testsuite/negative/tyenf.n	Sun Mar  5 17:42:28 2006
@@ -14,7 +14,7 @@
   f () : void {
     def f1 (x) { printf ("%s\n", x) };
     printf ("%d", f1 ("foo")); // E: expected int.*, got void in type-enforced expression
-    f1 (3); // E: in argument #1 \(x\), needed a string.*, got int
+    f1 (3); // E: in argument #1 \(x\).*, needed a string.*, got int
 
     _ = null : System.Int32; // E: expected int.*, got .* in type-enforced expression.*null
 

Modified: nemerle/trunk/ncc/typing/Typer-CallTyper.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer-CallTyper.n	(original)
+++ nemerle/trunk/ncc/typing/Typer-CallTyper.n	Sun Mar  5 17:42:28 2006
@@ -159,7 +159,7 @@
             def real_fun_ty = TypeOf (function_called);
             unless (real_fun_ty.Require (fun_ty))
               ReportError (messenger,
-                           $ "functional value was required to have type "
+                           $ "functional value ($function_called) was required to have type "
                              "$fun_ty while it has $real_fun_ty");
         }
 
@@ -212,9 +212,9 @@
           def name =
             if (messenger.NeedMessage)
               if (fparm == null)
-                $ "argument #$argument_number"
+                $ "argument #$argument_number of $function_called"
               else
-                $ "argument #$argument_number ($(fparm.name))"
+                $ "argument #$argument_number ($(fparm.name)) of $function_called"
             else "";
               
           ReportError (messenger, $ "in $name, $msg")

Modified: nemerle/trunk/ncc/typing/Typer-DelayedTyping.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer-DelayedTyping.n	(original)
+++ nemerle/trunk/ncc/typing/Typer-DelayedTyping.n	Sun Mar  5 17:42:28 2006
@@ -451,7 +451,7 @@
                       ReportError (messenger, "each overload has an error during call:");
                       mutable cnt = 1;
                       foreach (o in overloads) {
-                        ReportError (messenger, $ "  overload #$cnt, $o");
+                        ReportError (messenger, $ "overload #$cnt, $o");
                         print_error_message (o);
                         ++cnt;
                       }

Modified: nemerle/trunk/ncc/typing/Typer.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer.n	(original)
+++ nemerle/trunk/ncc/typing/Typer.n	Sun Mar  5 17:42:28 2006
@@ -2802,8 +2802,6 @@
             def res = TryTypeCall (fnc, parameters, expected,
                                    var_args = false, 
                                    final = true);
-            when (IsError (res))
-              ReportError (messenger, $ "typing error in call");
             res
         }
       



More information about the svn mailing list