[Issue 13435] Strange error if struct is a class member and opAssign applied

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 7 03:26:06 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13435

Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
           Severity|major                       |normal

--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Temtaime from comment #1)
> If this(T[] arg) {} is overloaded then error is gone. But it's strange in
> any case.

A first field assignment inside constructor is implicitly translated to the
field initializing. So the line `_a = d;` does not see opAssign.

http://dlang.org/class#field-init

But, I agree the diagnostic message is not good to understand what's the
problem.

--


More information about the Digitalmars-d-bugs mailing list