http://d.puremagic.com/issues/show_bug.cgi?id=2701
David Simcha <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #2 from David Simcha <[email protected]> 2010-08-15 21:11:33 PDT --- I'm closing this, since this appears to be what C'tors are for. The following example demonstrates. Perhaps this should be better documented, though. struct Bar { uint num; this(uint otherNum) { opAssign(otherNum); } Bar opAssign(uint otherNum) { num = otherNum; return this; } } void main() { int foo = 1; Bar bar = foo; // Error: e2ir: cannot cast from uint to Bar. Bar bar2; bar2 = foo; // Works. } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
