[Issue 18486] New: std.format cannot format const objects
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 21 18:09:41 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18486
Issue ID: 18486
Summary: std.format cannot format const objects
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: jack at jackstouffer.com
========
import std.format;
void main()
{
static class C {}
const(C) c;
format("%s", c);
}
========
/dlang/dmd/linux/bin64/../../src/phobos/std/format.d(3570): Error: template
instance std.format.formatObject!(Appender!string, const(C), char) does not
match template declaration formatObject(Writer, T, Char)(ref Writer w, ref T
val, ref const FormatSpec!Char f) if (hasToString!(T, Char))
/dlang/dmd/linux/bin64/../../src/phobos/std/format.d(1753): Error: template
instance std.format.formatValueImpl!(Appender!string, const(C), char) error
instantiating
/dlang/dmd/linux/bin64/../../src/phobos/std/format.d(567): instantiated
from here: formatValue!(Appender!string, const(C), char)
/dlang/dmd/linux/bin64/../../src/phobos/std/format.d(5831): instantiated
from here: formattedWrite!(Appender!string, char, const(C))
onlineapp.d(7): instantiated from here: format!(char, const(C))
--
More information about the Digitalmars-d-bugs
mailing list