SList and DList init doesn't work in global variable

Martin Krejcirik via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 28 14:15:05 PDT 2015


Is this intended or known issue ? It works with 2.066.

SList!int gslist = [1,2,3,4,5,6]; // broken since 2.067
// Error: reinterpreting cast from NodeWithoutPayload* to Node* is not
supported in CTFE

DList!int gdlist = [1,2,3,4,5,6]; // broken since 2.067
// Error: non-constant expression ...

void main()
{
    SList!int lslist = [1,2,3,4,5,6]; // OK
    DList!int ldlist = [1,2,3,4,5,6]; // OK
}

-- 
mk


More information about the Digitalmars-d-learn mailing list