Closed
Description
This code snippet gets an internal compiler error when encoding metadata. It should probably be rejected earlier on, since the innermost recv
function doesn't have type parameters. Adding <T: send>
to the inner function makes it compile successfully.
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> {
fn recv(+pipe: stream<T>) -> stream::stream<T> {
option::unwrap(pipes::recv(pipe))
}
recv
}
}
type stream<T: send> = pipes::recv_packet<stream::stream<T>>;
}
}