> immutable struct S {
>     int x;
>     this(int xx) { this.x = x; }
> }

As far as I know, immutable has no effect on class declarations, so what 
your code says is

struct S {
    immutable int x;
    this(int xx) immutable { this.x = x; }
}

and that's causing problems. If you want an immutable instance, you can say:

auto c = new immutable(C)(10);

or cast an existing instance to immutable.



Reply via email to