2011-03-25 14:19:20 -05:00
|
|
|
// xfail-stage0
|
2011-05-03 20:13:51 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2011-04-19 15:35:49 -05:00
|
|
|
fn start(chan[chan[str]] c) {
|
2010-08-11 17:05:33 -05:00
|
|
|
let port[str] p = port();
|
|
|
|
c <| chan(p);
|
2011-05-27 13:59:19 -05:00
|
|
|
auto a; p |> a;
|
|
|
|
// auto b; p |> b; // Never read the second string.
|
2010-08-11 17:05:33 -05:00
|
|
|
}
|
|
|
|
|
2011-04-19 15:35:49 -05:00
|
|
|
fn main() {
|
2010-08-11 17:05:33 -05:00
|
|
|
let port[chan[str]] p = port();
|
|
|
|
auto child = spawn "start" start(chan(p));
|
2011-05-27 13:59:19 -05:00
|
|
|
auto c; p |> c;
|
2010-08-11 17:05:33 -05:00
|
|
|
c <| "A";
|
|
|
|
c <| "B";
|
|
|
|
yield;
|
2011-05-26 20:17:13 -05:00
|
|
|
}
|