Bug 629 – Misleading error message "Can only append to dynamic arrays"

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P5
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-12-02T13:59:00Z
Last change time
2014-02-15T13:20:40Z
Keywords
diagnostic
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2006-12-02T13:59:44Z
void main() { real[] array; array ~= "string"; } The error message emitted from the above code is somewhat misleading: "[c]an only append to dynamic arrays, not real[] ~= char[6]". real[] _is_ a dynamic array, just of the wrong type.
Comment #1 by bugzilla — 2007-07-01T13:26:40Z
Fixed DMD 1.018 and DMD 2.002