Summary: Nested static if failing to execute
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2012-04-14 08:53:42 PDT ---
I tried this on the DMD64 D compiler v2.059 on linux. The valid D code at the
bottom fails with the following errors when I invoke 
$ rdmd static_if_bug.d 
static_if_bug.d(15): Error: undefined identifier 'foo'
Commenting out either "Bug trigger" below results in a successful compilation.

struct Klass {
    double value;

    //static const Klass zero; // Does not trigger bug!
    static const Klass zero = {0}; // Bug trigger #1

    static if (true) // Bug trigger #2
        static if (true)
            Klass foo() { return Klass(); }

void main() {
    auto a = Klass().foo();

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to