correct error message and add to test

This commit is contained in:
Niko Matsakis 2012-02-13 07:33:16 -08:00
parent 3a2f1e1876
commit 520c3f5f79
2 changed files with 2 additions and 1 deletions

View File

@ -621,7 +621,7 @@ fn compare_impl_method(tcx: ty::ctxt, sp: span, impl_m: ty::method,
"` has an incompatible set of type parameters");
ty::mk_fn(tcx, impl_m.fty)
} else if vec::len(impl_m.fty.inputs) != vec::len(if_m.fty.inputs) {
tcx.sess.span_err(sp,#fmt["method `%s`` has %u parameters \
tcx.sess.span_err(sp,#fmt["method `%s` has %u parameters \
but the iface has %u",
if_m.ident,
vec::len(impl_m.fty.inputs),

View File

@ -3,6 +3,7 @@ iface foo {
}
impl of foo for int {
fn bar() -> int {
//!^ ERROR method `bar` has 0 parameters but the iface has 1
self
}
}