Skip to content

Commit f7c9296

Browse files
committed
---
yaml --- r: 11260 b: refs/heads/master c: 4eb52f6 h: refs/heads/master v: v3
1 parent 94a31e1 commit f7c9296

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a7641e99e8e6830e4242cfe441a867eb6e955694
2+
refs/heads/master: 4eb52f69a9ebd39af4545fe7583f843edaa1a07d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/comp/middle/typeck.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,13 @@ fn compare_impl_method(tcx: ty::ctxt, sp: span, impl_m: ty::method,
620620
tcx.sess.span_err(sp, "method `" + if_m.ident +
621621
"` has an incompatible set of type parameters");
622622
ty::mk_fn(tcx, impl_m.fty)
623+
} else if vec::len(impl_m.fty.inputs) != vec::len(if_m.fty.inputs) {
624+
tcx.sess.span_err(sp,#fmt["method `%s`` has %u parameters \
625+
but the iface has %u",
626+
if_m.ident,
627+
vec::len(impl_m.fty.inputs),
628+
vec::len(if_m.fty.inputs)]);
629+
ty::mk_fn(tcx, impl_m.fty)
623630
} else {
624631
let auto_modes = vec::map2(impl_m.fty.inputs, if_m.fty.inputs, {|i, f|
625632
alt ty::get(f.ty).struct {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
iface foo {
2+
fn bar(x: uint) -> self;
3+
}
4+
impl of foo for int {
5+
fn bar() -> int {
6+
self
7+
}
8+
}
9+
10+
fn main() {
11+
}

0 commit comments

Comments
 (0)