On Thursday, 17 March 2016 at 10:11:43 UTC, Jeff Thompson wrote:
This is a simplified example from a larger class I have where I need an immutable constructor. This is because I need to construct an object an pass it to other functions which take an immutable object. So, how to keep an immutable constructor?
The "mutable object" the compiler is complaining about is the instance of C being constructed, not the array.
Change `new C(array)` to `new immutable(C)(array)` and it should work.