Is this a bug ?

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 21 09:55:52 PDT 2016


This very simple stuff:

class Item
{
     alias children this;
     Item[] children;
     void populate()
     {
         children ~= new Item;
         assert(children.length == 1);
     }
}

void main()
{
     Item root = new Item;
     root.populate;
}

leads to an assertion failure. Am I too tired to see the error or 
do you think it's a bug ?


More information about the Digitalmars-d-learn mailing list