Bug 19799 – templated string formatting fails with const Nullable!string

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-04-10T06:29:24Z
Last change time
2019-04-12T23:14:09Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature

Comments

Comment #0 by default_357-line — 2019-04-10T06:29:24Z
import std.stdio; import std.typecons; void main() { writefln!"%s"(const(Nullable!string)()); } ------ Expected: "Nullable.null" Got: horrible format template barf. Come on guys. This code is too simple to fail so badly.
Comment #1 by dlang-bot — 2019-04-10T07:16:49Z
@FeepingCreature created dlang/phobos pull request #6954 "Fix issue 19799: add const toString to Nullable" fixing this issue: - Fix issue 19799: add const toString to Nullable to avoid miscompilation in Nullable!string due to attempted implicit .get conversion to string https://github.com/dlang/phobos/pull/6954
Comment #2 by dlang-bot — 2019-04-12T23:14:09Z
dlang/phobos pull request #6954 "Fix issue 19799: add const toString to Nullable" was merged into master: - 4bc95f0fcaecfee4cf683fb3e8784e89f4b1fed4 by Mathis Beer: Fix issue 19799: add const toString to Nullable to avoid miscompilation in Nullable!string due to attempted implicit .get conversion to string https://github.com/dlang/phobos/pull/6954