[Issue 7940] CTFE wrong-code for opAssign and std.array.Appender

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 6 08:42:30 PST 2012


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



--- Comment #3 from Don <clugdbug at yahoo.com.au> 2012-11-06 08:42:28 PST ---
Reduced test case shows it's a subtle CTFE bug, involving assignment to a
member of a struct which is an element of a slice inside a struct.
----------

struct Bug7940 {
    int m;
}

struct App7940 {
   Bug7940[] x;
}

int bug7940() {
  Bug7940[2] y;
  App7940 app;
  app.x = y[0..1];
  app.x[0].m = 12;
  assert(y[0].m == 12);
  assert(app.x[0].m == 12); // also fails
  return 1;
}

static assert(bug7940());

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