Enum AA with classes not allowed anymore?

bauss jj_1337 at live.dk
Wed Oct 11 14:54:56 UTC 2017


On Sunday, 8 October 2017 at 04:40:59 UTC, Daniel Kozak wrote:
> Up to      2.062  : Failure with output:
> -----
> onlineapp.d(10): Error: cannot evaluate new Foo("0") at compile 
> time
> onlineapp.d(10): Error: cannot evaluate new Foo("1") at compile 
> time
> -----
>
> 2.063   to 2.072.2: Success with output: Hello D
> Since      2.073.2: Failure with output: onlineapp.d(10): 
> Error: variable
> onlineapp.aa : Unable to initialize enum with class or pointer 
> to struct.
> Use static const variable instead.
>
> https://run.dlang.io/is/mJqayC
>
> On Sun, Oct 8, 2017 at 4:29 AM, bauss via Digitalmars-d < 
> digitalmars-d at puremagic.com> wrote:
>
>> [...]

Do you know what the reason for the change is and are there any 
workarounds to actually declare AA's with classes that can be 
used at compile-time then?


More information about the Digitalmars-d mailing list