[Issue 18100] crt_constructor not allow to init immutable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 19 15:00:12 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18100

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com

--- Comment #2 from Steven Schveighoffer <schveiguy at yahoo.com> ---
I want to say this is WONTFIX.

remember that init1 is simply a function, it's not a static ctor. So if you
allowed it to rewrite immutable data, then something can call it later and mess
up the value.

If you want to do this, I think you need a cast. Not a tall order considering
there are no real guarantees from D on how this will work.

--


More information about the Digitalmars-d-bugs mailing list