www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18004] New: [Home]std.meta: template DerivedToFront(TList...)

https://issues.dlang.org/show_bug.cgi?id=18004

          Issue ID: 18004
           Summary: [Home]std.meta: template DerivedToFront(TList...) bug.
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: shove 163.com

file: std.meta
line: 745

template DerivedToFront(TList...)
{
...
}

Incorrect running result, Example code that demonstrates the behavior:

import std.meta;

 safe unittest
{
    class A { }
    class B : A { }
    class C : B { }

    alias Types2 = AliasSeq!(A, C, C, B, B, C);
    static assert(is(DerivedToFront!(Types2) == AliasSeq!(C, C, C, B, B, A)));
}

--
Nov 21