http://d.puremagic.com/issues/show_bug.cgi?id=9559
Summary: Range of Nullable doesn't work with std.array.array
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Justin Whear <[email protected]> 2013-02-21
11:24:22 PST ---
Using std.array.array on a range of Nullable!T causes a runtime error if at
least one of the elements is set to null. Test case:
----------------------
import std.algorithm;
import std.typecons;
void main()
{
alias Nullable!int I;
auto ints = [0, 1, 2].map!(i => i & 1 ? I.init : I(i));
auto asArray = std.array.array(ints);
}
----------------------
Produces the following error:
object.Exception@/usr/include/dmd/phobos/std/typecons.d(1181): Enforcement
failed
Full backtrace here: http://pastebin.com/wMFRKk6L
The enforcement exception occurs in Nullable's get() function (I'm using 2.062,
I noticed that this has been changed to an assert in HEAD) and Nullable has an
alias this to get. Best guess is that this is actually a problem in emplace or
array's usage of it.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------