Closed
Description
Pipe protocols allow for some rather magical things regarding types. For example, consider this protocol:
proto! type_switch {
start:send {
get_int -> wait_thing<int>,
get_str -> wait_thing<~str>
}
wait_thing:recv<T:send> {
thing(T) -> start
}
}
Furthermore, start
could be polymorphic itself and go to different instances of wait_thing
.
This is really flexible. Whether this flexibility is desirable is definitely a valid question.
If we decide we do want this flexibility, the protocol compiler needs to be sure to handle this correctly. I think compiling that protocol as an unbounded protocol would probably work fine, but the bounded version will probably fail in mysterious ways.
If we decide we don't want that flexible of polymorphic protocols, we should change the item macro syntax so we can do this instead:
proto! type_switch<T: send> {
start:send {
get -> wait_thing
}
wait_thing {
thing(T) -> start
}
}