I have an example of code like this:

template Node(String)
{
        struct Node {}
        struct Name {}
        struct Attr {}
        
}

void main()
{
        alias MyNode = Node!(string).Node;
        alias MyName = Node!(string).Name;
        alias MyAttr = Node!(string).Attr;
        
}

This code fails during compilation with message:

Compilation output:

/d228/f410.d(12): Error: no property 'Node' for type 'Node!string' /d228/f410.d(12): Error: no property 'Node' for type 'Node!string' /d228/f410.d(13): Error: no property 'Name' for type 'Node!string' /d228/f410.d(13): Error: no property 'Name' for type 'Node!string' /d228/f410.d(14): Error: no property 'Attr' for type 'Node!string' /d228/f410.d(14): Error: no property 'Attr' for type 'Node!string'

So question is: is this intended behaviour and I'm missing something about eponymous templates? Or is it a bug in compiler?

Reply via email to