www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15182] New: only(enums) refused


          Issue ID: 15182
           Summary: only(enums) refused
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

void main() {
    import std.range: only;
    enum Test { A }
    only(Test.A, Test.A);

dmd v2.067:

...\src\phobos\std\range\package.d(6046): Error: cannot implicitly convert
expression (0) of type int to Test[2]
test.d(4): Error: template instance std.range.only!(Test, Test) error

Oct 09 2015