www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11539] New: wrong "Orphan format specifier:" error message

https://d.puremagic.com/issues/show_bug.cgi?id=11539

           Summary: wrong "Orphan format specifier:" error message
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com


--- Comment #0 from monarchdodra gmail.com 2013-11-18 06:05:24 PST ---
//----
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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 18 2013