http://d.puremagic.com/issues/show_bug.cgi?id=7126
Summary: struct constructor ignored with global initializers
Product: D
Version: D2
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2011-12-17 12:58:30 PST ---
struct new_int
{
this(int val)
{
payload = val;
}
int payload = -1;
alias payload this;
}
new_int a = 1; // Error: cannot implicitly convert expression (1) of type int
to new_int
void main()
{
new_int b = 1; // Works ok
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------