← Back to index
|
Original Bugzilla link
Bug 19435 – AssertError when trying to print an array of Nullables containing nullified ones
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-11-26T11:20:09Z
Last change time
2019-12-07T13:53:29Z
Assigned to
No Owner
Creator
Piotr Mitana
Comments
Comment #0
by piotr.mitana — 2018-11-26T11:20:09Z
Code will be probably sufficient here: ============================================================ import std.stdio; import std.typecons; void main() { [Nullable!string.init].writeln; } ============================================================ core.exception.AssertError@/dlang/dmd/linux/bin64/../../src/phobos/std/typecons.d(2864): Called `get' on null Nullable!string. ---------------- ??:? _d_assert_msg [0x6fe816de] /dlang/dmd/linux/bin64/../../src/phobos/std/typecons.d:2864 inout pure nothrow ref @property @nogc @safe inout(immutable(char)[]) std.typecons.Nullable!(immutable(char)[]).Nullable.get() [0x6fe701c5] /dlang/dmd/linux/bin64/../../src/phobos/std/format.d:3425 @safe void std.format.formatElement!(std.stdio.File.LockingTextWriter, std.typecons.Nullable!(immutable(char)[]).Nullable, char).formatElement(ref std.stdio.File.LockingTextWriter, std.typecons.Nullable!(immutable(char)[]).Nullable, ref const(std.format.FormatSpec!(char).FormatSpec)) [0x6fe7c5b4] /dlang/dmd/linux/bin64/../../src/phobos/std/format.d:3312 @safe void std.format.formatRange!(std.stdio.File.LockingTextWriter, std.typecons.Nullable!(immutable(char)[]).Nullable[], char).formatRange(ref std.stdio.File.LockingTextWriter, ref std.typecons.Nullable!(immutable(char)[]).Nullable[], ref const(std.format.FormatSpec!(char).FormatSpec)) [0x6fe7c04b] /dlang/dmd/linux/bin64/../../src/phobos/std/format.d:3000 @safe void std.format.formatValueImpl!(std.stdio.File.LockingTextWriter, std.typecons.Nullable!(immutable(char)[]).Nullable[], char).formatValueImpl(ref std.stdio.File.LockingTextWriter, std.typecons.Nullable!(immutable(char)[]).Nullable[], ref const(std.format.FormatSpec!(char).FormatSpec)) [0x6fe7be8c] /dlang/dmd/linux/bin64/../../src/phobos/std/format.d:1853 @safe void std.format.formatValue!(std.stdio.File.LockingTextWriter, std.typecons.Nullable!(immutable(char)[]).Nullable[], char).formatValue(ref std.stdio.File.LockingTextWriter, ref std.typecons.Nullable!(immutable(char)[]).Nullable[], ref const(std.format.FormatSpec!(char).FormatSpec)) [0x6fe7be5f] /dlang/dmd/linux/bin64/../../src/phobos/std/format.d:574 @safe uint std.format.formattedWrite!(std.stdio.File.LockingTextWriter, char, std.typecons.Nullable!(immutable(char)[]).Nullable[]).formattedWrite(ref std.stdio.File.LockingTextWriter, const(char[]), std.typecons.Nullable!(immutable(char)[]).Nullable[]) [0x6fe7b2b9] /dlang/dmd/linux/bin64/../../src/phobos/std/stdio.d:1505 @safe void std.stdio.File.write!(std.typecons.Nullable!(immutable(char)[]).Nullable[], char).write(std.typecons.Nullable!(immutable(char)[]).Nullable[], char) [0x6fe7af0e] /dlang/dmd/linux/bin64/../../src/phobos/std/stdio.d:3811 @safe void std.stdio.writeln!(std.typecons.Nullable!(immutable(char)[]).Nullable[]).writeln(std.typecons.Nullable!(immutable(char)[]).Nullable[]) [0x6fe7ae73] onlineapp.d:6 _Dmain [0x6fe700a9]
Comment #1
by bugzilla — 2019-12-07T13:53:29Z
*** This issue has been marked as a duplicate of issue 17269 ***