http://d.puremagic.com/issues/show_bug.cgi?id=7014
Denis Shelomovskij <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Denis Shelomovskij <[email protected]> 2013-09-30 18:30:34 MSD --- Another option may be to extend "static initialization" syntax: --- struct S { int i; double d; } union U { int i; double d; } void f(T)(T){} void main() { S s = { d: 5 }; // OK U u = { d: 5 }; // NG because of Issue 7727 // Original suggestion: f(S( d: 5 )); // yes, let's not separate structs and unions f(U( d: 5 )); // Another option: f(cast(S) { d: 5 }); f(cast(U) { d: 5 }); } --- I'd like to require a `cast` even if the argument type is known. And about original suggestion: Having naming arguments in D (not only in this case) looks like a good idea allowing one another coding style. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
