rust/src/test/compile-fail/issue-2766-a.rs

22 lines
822 B
Rust
Raw Normal View History

mod stream {
enum stream<T: send> { send(T, server::stream<T>), }
mod server {
2012-08-07 18:10:06 -07:00
impl<T: send> 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
}
}
2012-08-28 11:11:15 -07:00
type stream<T: send> = pipes::RecvPacket<stream::stream<T>>;
}
}
fn main() {}