rust/src/test/run-pass/issue-2288.rs

21 lines
282 B
Rust
Raw Normal View History

2012-07-13 16:44:48 -05:00
iface clam<A: copy> {
fn chowder(y: A);
}
class foo<A: copy> : clam<A> {
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);
}