www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15801] New: Overloaded alias parameter variable cannot be

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

          Issue ID: 15801
           Summary: Overloaded alias parameter variable cannot be read at
                    compile-time
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ntrel-pub mybtinternet.com

enum foo(int n) = 2;
enum foo(alias sym) = 3;

string str;

static assert(foo!str == 3); // line 13

With dmd 2.070.2, compiler gives:
enumaliasparam.d(13): Error: static variable str cannot be read at compile time

If I uncomment the foo(int n) overload, it does compile. str is not an int, so
that overload should not affect the assert.

--
Mar 15 2016