Bug 22279 – alias this in Nullable(T, T nullValue) causes Error in writeln

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-09-04T17:41:47Z
Last change time
2024-12-01T16:39:15Z
Assigned to
No Owner
Creator
Jack Stouffer
Moved to GitHub: phobos#10474 →

Comments

Comment #0 by jack — 2021-09-04T17:41:47Z
Calling toString on a Tuple with a null Nullable results in a AssertError Reduced case: ``` import std.typecons; import std.stdio; struct Result { Nullable!(int, int.min) a; } auto func() { Result res; return tuple(res); } void main() { writeln(func()); } ```
Comment #1 by jack — 2021-09-04T17:44:04Z
Just realized the root cause of this is the alias this. This should be deprecated and removed.
Comment #2 by robert.schadek — 2024-12-01T16:39:15Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10474 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB