Bug 11539 – wrong "Orphan format specifier:" error message
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-18T06:05:00Z
Last change time
2014-09-21T22:59:53Z
Keywords
pull
Assigned to
nobody
Creator
monarchdodra
Comments
Comment #0 by monarchdodra — 2013-11-18T06:05:24Z
//----
import std.stdio;
void main()
{
writefln("%s"); //1
writefln("%s hello %s"); //2
}
//----
Produces:
//1
std.format.FormatException@C:\D\dmd.2.064.2\dmd2\windows\bin\..\..\src\phobos\std\format.d(438): Orphan format specifier: %%s
//2
std.format.FormatException@C:\D\dmd.2.064.2\dmd2\windows\bin\..\..\src\phobos\std\format.d(438): Orphan format specifier: %%s hello %s
It appears the error message contains the actual format string, and not the actual format specifier.
The fix is trivial, and in said exception line:
text("Orphan format specifier: %", fmt));
s/fmt/spec.spec/
to fix