[Issue 2096] New: Non-static struct initialization/assingment
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun May 11 11:57:16 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2096
Summary: Non-static struct initialization/assingment
Product: D
Version: 2.013
Platform: PC
OS/Version: Windows
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: terranium at yandex.ru
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.
--
More information about the Digitalmars-d-bugs
mailing list