[Issue 11346] New: [2.064 beta] field initializing not allowed in loops or after labels

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 24 14:00:27 PDT 2013


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

           Summary: [2.064 beta] field initializing not allowed in loops
                    or after labels
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: rswhite4 at googlemail.com


--- Comment #0 from rswhite4 at googlemail.com 2013-10-24 14:00:25 PDT ---
Code:
----
import std.stdio;

struct Test {
public:
    const int[] test;

    this(int i) {
        for (size_t j = 0; j < 4; ++j) {
            this.test ~= i + j;
        }
    }
}

void main() {
    Test t = Test(42);
}
----

Error: field test initializing not allowed in loops or after labels

WTF?

-- 
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