https://issues.dlang.org/show_bug.cgi?id=7019
--- Comment #16 from Denis Shelomovskij <[email protected]> --- (In reply to Kenji Hara from comment #15) > (In reply to Denis Shelomovskij from comment #14) > > static assert(!__traits(compiles, { S2 s2 = { 5 }; })); // fails > > static assert(!__traits(compiles, { S2 s2 = { s: 5 }; })); // fails > > These are expected behavior. > The target type of the argument '5' can be determined to S, so implicit > constructor call is handled. How does `S2 s2 = { 5 }` differ from `f(5)` or `S2 s2 = S2(5)`? IMO the only clean rule is: "Implicit conversion exists iff target type is explicitly stated." What is wrong with this rule? What rules and why are preferred? --
