[Issue 9404] Nullable is unusable with 2.061

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 26 13:42:11 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9404


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|regression                  |enhancement


--- Comment #4 from monarchdodra at gmail.com 2013-01-26 13:42:10 PST ---
(In reply to comment #3)
> Thanks for your analysis!
> 
> I wonder, though, how is this correct behaviour? My understanding is, since SS
> doesn't have opAssign, bitwise copy should happen in SSS constructor, and
> that's it. Why does S.opAssign get called in this case?
> 
> > AFAIK, 2.061 is the correct behavior. Something must have been fixed in 2.061,
> > so that explains the *change* in behavior. So there should be nothing to fix
> > there... But I'll let own of the compiler guys confirm.
> > 
> > In any case, I'll fix open a pull to improve Nullable to accept assignment from
> > another nullable.

Technically, when S doesn't have an opAssign, then a *postblit* is called
(which will basically be a bitwise copy when there is no postblit).

However, this only happens when there is NO opAssign at all. If there is an
opAssign, then the compiler must call one of the existing opAssigns. Nullable
does have an opAssign though (the one taking a T), so that is what the compiler
is calling.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list