[Issue 12118] Modify immutable data using throw

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 9 23:01:31 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12118



--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2014-02-09 23:01:11 PST ---
(In reply to comment #0)
At least, defining immutable constructor in derived classes of Throwable should
be disallowed.

> class Dummy: Exception
> {
>     int[] data;
>     @safe pure nothrow this(immutable int[] data) immutable
>     {
>         super("Dummy");

   --> during immutable object construction, mutable super constructor should
not
be invoked.

>         this.data = data;
>     }
> }

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


More information about the Digitalmars-d-bugs mailing list