http://d.puremagic.com/issues/show_bug.cgi?id=9441
Summary: struct constructor missed on auto/type-inferred
variable definition
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
Blocks: 340
--- Comment #0 from Marco Leise <[email protected]> 2013-02-01 15:28:13 PST ---
This should compile but doesn't:
auto x = X(0.123);
struct X {
int a;
this(double) {}
}
Error: cannot implicitly convert expression (0.123) of type double to int
It works if I reverse the order of declaration for X and x or I don't use type
inference for x. E.g. a classical forward reference bug.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------