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



--- Comment #4 from Graham Fawcett <graham.fawc...@gmail.com> 2010-06-16 
06:39:19 PDT ---
Created an attachment (id=664)
proposed patch

When initializing an array, this patch tests whether the initializer
is a VoidInitializer, and if so, avoids the toExpression() call. This
permits arrays to be initialized "= void".

This compiles and appears to work as expected:

void main() {
  struct foo {
    union {
      char[100] c = void;
      ubyte[100] b
    }
    ubyte[5] good = 44;
    ubyte[5] bad  = void;
  }
  foo f = foo();
  writeln("b ", f.b);
  writeln("c ", f.c);
  writeln("good ", f.good);
  writeln("bad ", f.bad);
}

"good" displays as '44 44 44 44 44', but the void attributes appear
uninitialized.

This still fails to compile (as it should):

void main() {
  void[1] a;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to