[Issue 7911] New: Nested static if failing to execute

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 14 08:52:53 PDT 2012


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: nobody at puremagic.com
        ReportedBy: marcianx at gmail.com


--- Comment #0 from marcianx at 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: -------


More information about the Digitalmars-d-bugs mailing list