https://issues.dlang.org/show_bug.cgi?id=23488
Issue ID: 23488
Summary: std.format.sformat mishandles char ranges
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
struct R
{
string s = "Ü";
bool empty() { return s.length == 0; }
char front() { return s[0]; }
void popFront() { s = s[1 .. $]; }
}
void main()
{
import std.format: sformat;
char[2] buf;
assert(sformat(buf, "%s", R()) == "Ü"); /* fails; should pass */
}
--