[Issue 6286] New: Static arrays can not be assigned from const(T)[N] to T[N]
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 11 01:58:11 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6286
Summary: Static arrays can not be assigned from const(T)[N] to
T[N]
Product: D
Version: unspecified
Platform: Other
OS/Version: Windows
Status: NEW
Severity: regression
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: ludwig at informatik.uni-luebeck.de
--- Comment #0 from Sönke Ludwig <ludwig at informatik.uni-luebeck.de> 2011-07-11 01:52:55 PDT ---
The following snipped worked up to DMD 2.053 but fails on 2.054:
---
void test()
{
const(int)[4] src = [1, 2, 3, 4];
int[4] dst;
dst = src; // Error: cannot implicitly convert expression (src) of type
const(int[4u]) to int[]
dst[] = src[]; // still works
}
---
The assignment "T[N] = const(T)[N]" should work as long as "T = const(T)" works
as there is no aliasing goind on but just a plain copy.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list