2012-06-01 19:48:07 -05:00
|
|
|
// Test that a class with an unsendable field can't be
|
|
|
|
// sent
|
|
|
|
|
2012-08-15 20:46:55 -05:00
|
|
|
struct foo {
|
2012-06-01 19:48:07 -05:00
|
|
|
let i: int;
|
2012-07-14 00:57:48 -05:00
|
|
|
let j: @~str;
|
|
|
|
new(i:int, j: @~str) { self.i = i; self.j = j; }
|
2012-06-01 19:48:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-07-14 15:55:41 -05:00
|
|
|
let cat = ~"kitty";
|
2012-06-30 06:23:59 -05:00
|
|
|
let po = comm::port(); //~ ERROR missing `send`
|
|
|
|
let ch = comm::chan(po); //~ ERROR missing `send`
|
|
|
|
comm::send(ch, foo(42, @cat)); //~ ERROR missing `send`
|
2012-07-14 15:55:41 -05:00
|
|
|
}
|