2012-07-31 12:27:51 -05:00
|
|
|
trait clam<A: copy> {
|
2012-07-13 16:44:48 -05:00
|
|
|
fn chowder(y: A);
|
|
|
|
}
|
2012-08-15 20:46:55 -05:00
|
|
|
struct foo<A: copy> : clam<A> {
|
2012-07-13 16:44:48 -05:00
|
|
|
let x: A;
|
|
|
|
new(b: A) { self.x = b; }
|
|
|
|
fn chowder(y: A) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn f<A: copy>(x: clam<A>, a: A) {
|
|
|
|
x.chowder(a);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
let c = foo(42);
|
|
|
|
let d: clam<int> = c as clam::<int>;
|
|
|
|
f(d, c.x);
|
|
|
|
}
|