rust/src/test/compile-fail/ambig_impl_unify.rs

17 lines
314 B
Rust
Raw Normal View History

trait foo {
fn foo() -> int;
}
2012-08-07 18:10:06 -07:00
impl ~[uint]: foo {
fn foo() -> int {1} //~ NOTE candidate #1 is `__extensions__::foo`
}
2012-08-07 18:10:06 -07:00
impl ~[int]: foo {
fn foo() -> int {2} //~ NOTE candidate #2 is `__extensions__::foo`
}
fn main() {
let x = ~[];
x.foo(); //~ ERROR multiple applicable methods in scope
}