aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/task-comm-10.rs
blob: e0164596390da809978b6e70b649c8dee81bbd64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
impure fn start(chan[chan[str]] c) {
    let port[str] p = port();
    c <| chan(p);
    auto a <- p;
    // auto b <- p; // Never read the second string.
}

impure fn main() {
    let port[chan[str]] p = port();
    auto child = spawn "start" start(chan(p));
    auto c <- p;
    c <| "A";
    c <| "B";
    yield;
}