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

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 629 - Misleading error message "Can only append to dynamic arrays"
Summary: Misleading error message "Can only append to dynamic arrays"
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P5 trivial
Assignee: Walter Bright
URL:
Keywords: diagnostic
Depends on:
Blocks:
Reported: 2006年12月02日 13:59 UTC by Matti Niemenmaa
Modified: 2014年02月15日 13:20 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Matti Niemenmaa 2006年12月02日 13:59:44 UTC
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 Walter Bright 2007年07月01日 13:26:40 UTC
Fixed DMD 1.018 and DMD 2.002


AltStyle によって変換されたページ (->オリジナル) /