[svn] r7405: nemerle/trunk/ncc: testsuite/negative/return-type.n
typing/Typer.n
nazgul
svnadmin at nemerle.org
Sun Feb 11 20:44:10 CET 2007
Log:
Cleaner error message
Author: nazgul
Date: Sun Feb 11 20:44:07 2007
New Revision: 7405
Modified:
nemerle/trunk/ncc/testsuite/negative/return-type.n
nemerle/trunk/ncc/typing/Typer.n
Modified: nemerle/trunk/ncc/testsuite/negative/return-type.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/return-type.n (original)
+++ nemerle/trunk/ncc/testsuite/negative/return-type.n Sun Feb 11 20:44:07 2007
@@ -1,5 +1,5 @@
class M {
- static g () : string { 3 } // E: expected string.*, got int in function return type
+ static g () : string { 3 } // E: expected string.*, got int in function return value
static h () : void { ().x = 4 } // E: there is no member named `x' in void
}
class A { public this () {} }
@@ -7,13 +7,13 @@
class B {
f1 () : void { null } // W: ignored
- static f ['a] (_ : 'a) : 'a where 'a : A { A() } // E: expected 'a.*, got A in function return type
+ static f ['a] (_ : 'a) : 'a where 'a : A { A() } // E: expected 'a.*, got A in function return value
}
class X {
static f () : void {
- def g () : int { () }; // E: expected int.*, got void in function return type
- def h () : int { }; // E: expected int.*, got void in function return type
+ def g () : int { () }; // E: expected int.*, got void in function return value
+ def h () : int { }; // E: expected int.*, got void in function return value
def _ = g () + h ();
()
}
Modified: nemerle/trunk/ncc/typing/Typer.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer.n (original)
+++ nemerle/trunk/ncc/typing/Typer.n Sun Feb 11 20:44:07 2007
@@ -339,7 +339,7 @@
MakeImplicitBlockJumpOut ("_N_return", current_fun.ret_type);
def e' = TypeExpr (e);
messenger.CleanLocalError ();
- def e' = AddCastTo (e', current_fun.ret_type, "function return type");
+ def e' = AddCastTo (e', current_fun.ret_type, "function return value");
def e' =
if (skip_n_return) e'
else TExpr.Block (current_fun.ret_type, local, e');
More information about the svn
mailing list