http://d.puremagic.com/issues/show_bug.cgi?id=10006
Summary: Implicit conversion in initializers doesn't work for
subtypes
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrej Mitrovic <[email protected]> 2013-04-29
03:30:47 PDT ---
-----
struct S
{
float value = 0.0;
alias value this;
}
float f = 250.0; // ok
S s = 250.0; // ng
void main() { }
-----
Error: cannot implicitly convert expression (250.000) of type double to S
I think the above should work.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------