mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
Test for #2288
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user