Bug 1342 – struct const not accepted as initializer for another struct
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-07-14T19:09:00Z
Last change time
2015-06-09T01:04:59Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
torhu
Comments
Comment #0 by torhu — 2007-07-14T19:09:41Z
---
struct S
{
int value;
}
const S s = { 5 };
const S t = s; // ok
S u = s; // line 9, fails
---
//newbug.d(9): Error: non-constant expression cast(S)s
Making s invariant doesn't help.