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

          Issue ID: 21795
           Summary: Spurious error: static variable `i` cannot be read at
                    compile time as default argument to template alias
                    parameter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

template G(T)
{
    struct G
    {
        static int i;
    }
}

struct H2(F = float, alias e_ = G!double.i) {}
H2!(float) c; // fails with "static variable `i` cannot be read at compile
time"

H2!(float, G!double.i) c; // passes

see also https://issues.dlang.org/show_bug.cgi?id=16472

--

Reply via email to