Bug 7929 – Broken semantic of StructInitializer with const
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-16T18:01:00Z
Last change time
2012-04-19T17:03:18Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2012-04-16T18:01:45Z
From d.learn newsgroup:
http://forum.dlang.org/thread/[email protected]#post-jmhbk2:24ra2:241:40digitalmars.com
struct S
{
int [] numbers;
}
void main()
{
const int [] numbers = new int[2];
const S si = {numbers};
// Error: cannot implicitly convert expression (numbers) of type
// const(int[]) to int[]
const S se = const(S)(numbers);
// OK
}
This is a bug in processing StructInitializer semantic.