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

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3069 - Issue 3069 - Array literals do not implicitly cast to void[]
Summary: Issue 3069 - Array literals do not implicitly cast to void[]
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
Reported: 2009年06月15日 02:05 UTC by Vladimir Panteleev
Modified: 2015年06月09日 05:10 UTC (History)
2 users (show)

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 Vladimir Panteleev 2009年06月15日 02:05:49 UTC
=== 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 yebblies 2011年09月07日 02:17:14 UTC
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 


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