http://d.puremagic.com/issues/show_bug.cgi?id=7911

           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
        AssignedTo: nob...@puremagic.com
        ReportedBy: marci...@gmail.com


--- Comment #0 from marci...@gmail.com 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to