[Issue 7019] implicit constructors are inconsistently allowed
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Jun 23 21:53:30 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=7019
Kenji Hara <k.hara.pg at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #15 from Kenji Hara <k.hara.pg at gmail.com> ---
Remained issue will be fixed by issue 8864.
struct S { this(int) { } }
S[2] a = [1,2]; // Converted to: [S(1), S(2)]
(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.
--
More information about the Digitalmars-d-bugs
mailing list