[Issue 9559] Range of Nullable doesn't work with std.array.array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 21 13:26:33 PST 2013


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


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #2 from monarchdodra at gmail.com 2013-02-21 13:26:31 PST ---
(In reply to comment #1)
> I don't have a good testing environment at the moment, but it looks like the
> bug might be here:
> https://github.com/D-Programming-Language/phobos/blob/master/std/conv.d#L3581
> 
> If I understand this correctly, this static if will succeed because the
> Nullable!int constructor will accept another Nullable!int due to the alias
> this.  When the constructor is called, the alias this causes the get() function
> to be called in order to resolve the Nullable being copied to an int.
> 
> Possible fix: add a constructor to Nullable that takes typeof(this) and
> correctly checks isNull.

This gets fixed by my existing fix for emplace.

The pull is here:
https://github.com/D-Programming-Language/phobos/pull/1082

And I just added a unittest for this specific bug:
https://github.com/monarchdodra/phobos/commit/10025b835e564d17fd960d461e965e9bb80d115d

-- 
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