This prints nothing:

```
import std.concurrency;
import std.stdio;

class A
{
    string toString() immutable
    {
        return "aaa";
    }
}

void thread()
{
    for (;;)
    {
        receive(
            (immutable A x) {
                writeln(x);
            },
            (Variant x) {
                writeln(x.type);
                writeln(x);
            }
        );
    }
}

void main()
{
    auto tid1 = spawn(&thread);
    auto val = new immutable A();
//    tid1.send(42);
    tid1.send(val);
    for (;;) {}
}

}
```

Any ideas? :)

Reply via email to