Enum AA with classes not allowed anymore?
Daniel Kozak
kozzi11 at gmail.com
Wed Oct 11 15:05:19 UTC 2017
so you can try to use static immutable insted of enum
On Wed, Oct 11, 2017 at 5:04 PM, Daniel Kozak <kozzi11 at gmail.com> wrote:
> Not sure, but I belive this could be one of reasons:
> https://issues.dlang.org/show_bug.cgi?id=15989
>
> On Wed, Oct 11, 2017 at 4:54 PM, bauss via Digitalmars-d <
> digitalmars-d at puremagic.com> wrote:
>
>> 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?
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20171011/39c23990/attachment.html>
More information about the Digitalmars-d
mailing list