Bug 3069 – Issue 3069 - Array literals do not implicitly cast to void[]

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-06-15T02:05:00Z
Last change time
2015-06-09T05:10:41Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2009-06-15T02:05:49Z
=== Testcase === void main() { ubyte id; void[] v = [id] ~ [id]; } === Compiler output === test.d(4): Error: cannot implicitly convert expression ([id,id]) of type ubyte[] to void[] === Testcase end === Adding [] after either [id] allows the code to compile. This is probably related to #3068, if it isn't actually the same bug...
Comment #1 by yebblies — 2011-09-07T02:17:14Z
Nothing to do with concatenation, array literals don't convert to void[]. void main() { ubyte id; void[] v = [id]; } https://github.com/D-Programming-Language/dmd/pull/371
Comment #2 by bugzilla — 2011-09-10T20:20:59Z