2012-12-10 17:32:48 -08:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-07-11 15:00:40 -07:00
|
|
|
trait foo {
|
2013-03-12 19:32:14 -07:00
|
|
|
fn foo(&self) -> int;
|
2012-07-11 15:00:40 -07:00
|
|
|
}
|
|
|
|
|
2013-02-14 11:47:00 -08:00
|
|
|
impl foo for ~[uint] {
|
2014-02-14 07:07:09 +02:00
|
|
|
fn foo(&self) -> int {1} //~ NOTE candidate #1 is `~[uint].foo::foo`
|
2012-05-25 08:42:39 -07:00
|
|
|
}
|
|
|
|
|
2013-02-14 11:47:00 -08:00
|
|
|
impl foo for ~[int] {
|
2014-02-14 07:07:09 +02:00
|
|
|
fn foo(&self) -> int {2} //~ NOTE candidate #2 is `~[int].foo::foo`
|
2012-05-25 08:42:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-06-29 16:26:56 -07:00
|
|
|
let x = ~[];
|
2012-06-30 12:23:59 +01:00
|
|
|
x.foo(); //~ ERROR multiple applicable methods in scope
|
2012-07-11 15:00:40 -07:00
|
|
|
}
|