Bug 2096 – Non-static struct initialization/assingment

Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2008-05-11T13:57:00Z
Last change time
2017-07-02T01:30:07Z
Assigned to
nobody
Creator
dfj1esp02
Blocks
1253

Comments

Comment #0 by dfj1esp02 — 2008-05-11T13:57:14Z
struct A { int a,b; } void f() { int[4] rgi=[1,2,3,4]; //(1) ok? why? A x={1,2}; //(2) ok A y={a:1,b:2}; //(3) fail. why? x=A(1,2); //(4) ok x=A(a:1,b:2); //(5) fail x={1,2}; //(6) fail x={a:1,b:2}; //(7) fail } Why third line doesn't work? And making 5th or 7th line work will be also nice.
Comment #1 by dlang-bugzilla — 2017-07-02T01:30:07Z
Line (3) was fixed in 2.053. The last 3 are non-trivial language changes and would need to be done as DIPs. At least some of them look somewhat syntactically ambiguous, too (with delegate literals).