rust/src/test/compile-fail/issue-2766-a.rs
2012-07-09 19:16:23 -07:00

22 lines
832 B
Rust

mod stream {
enum stream<T: send> { send(T, server::stream<T>), }
mod server {
impl recv<T: send> for stream<T> {
fn recv() -> extern fn(+stream<T>) -> stream::stream<T> {
// resolve really should report just one error here.
// Change the test case when it changes.
fn recv(+pipe: stream<T>) -> stream::stream<T> { //~ ERROR attempt to use a type argument out of scope
//~^ ERROR use of undeclared type name
//~^^ ERROR attempt to use a type argument out of scope
//~^^^ ERROR use of undeclared type name
option::unwrap(pipes::recv(pipe))
}
recv
}
}
type stream<T: send> = pipes::recv_packet<stream::stream<T>>;
}
}
fn main() {}