[Issue 15801] New: Overloaded alias parameter variable cannot be read at compile-time

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Mar 15 05:37:09 PDT 2016


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 at puremagic.com
          Reporter: ntrel-pub at 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.

--


More information about the Digitalmars-d-bugs mailing list