Summary: Forward reference to two-level nested static if
                    symbols fails within struct
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD

--- Comment #0 from Peter Alexander <> 2012-04-15 
07:33:07 PDT ---
This code fails in DMD 2.059, but worked in 2.058

struct A
  static immutable A a = A(0);

  static if (true)
    static if (true)
      this(int) {}
% dmd test.d
test.d(4): Error: more initializers than fields (0) of A

If you remove one of the static ifs, the error goes away.

If you move the definition of 'a' below the constructor, the error goes away.

In this case I am trying to forward reference a constructor, but it also
happens with other symbols.

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

Reply via email to