Updated case after some experiments:
```
import std.concurrency;
import std.stdio;

class A
{
override string toString() const // this was an issue, it must be exact override
    {
        return "aaa";
    }
}

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

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

This prints expected:
```
immutable(test.A)
aaa
```

However, uncommenting `immutable(A)` receiver makes it silent again.

Reply via email to