Bug 5120 – ICE(mtype.c) void associative arrays

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-10-25T22:16:00Z
Last change time
2010-11-07T14:12:18Z
Keywords
ice-on-valid-code, patch
Assigned to
nobody
Creator
sandford

Comments

Comment #0 by sandford — 2010-10-25T22:16:41Z
The following: enum c = (void[int]).sizeof; Results in an 'impl' on line 4018 in file 'mtype.c' with DMD 2.049. I've marked this ICE on valid, since void[int] b; is currently accepted as a valid declaration by DMD.
Comment #1 by clugdbug — 2010-10-30T06:37:11Z
It should just be illegal to have an AA of type void. If applied to D1 as well, this would close bug 1606 "Cannot insert to void[int]. void[int] should be a hash set." which has been open with a patch for a thousand years. mtype.c, line 3956, TypeAArray::semantic() ---- switch (next->toBasetype()->ty) { case Tfunction: + case Tvoid: case Tnone: error(loc, "can't have associative array of %s", next->toChars()); return Type::terror; }
Comment #2 by bugzilla — 2010-11-07T14:12:18Z