http://d.puremagic.com/issues/show_bug.cgi?id=11343



--- Comment #3 from Kenji Hara <[email protected]> 2013-10-24 17:22:40 PDT ---
(In reply to comment #1)
> Consider also this:
> 
> ----
> import std.stdio;
> 
> struct Test {
> public:
>     const int[] test;
> 
>     this(int i) {
>         this.test ~= i;
>         this.test ~= i + 1;
>     }
> }
> 
> void main() {
>     Test t = Test(42);
> }
> ----
> 
> Same error

The code modifies a non-mutable array field 'const(int[]) test' twice.
Create temporary int[] and initialize Test.test by that.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to