[Issue 10139] New: writef does not behave according to documentation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 22 19:39:21 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10139

           Summary: writef does not behave according to documentation
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: gdkslpmq at spam4.me


--- Comment #0 from Derek Rhodes <gdkslpmq at spam4.me> 2013-05-22 19:39:20 PDT ---
According to the std.stdio page on the D website, the behaviour of writef
should be:

"If the first argument args[0] is a FILE*, use the format specifier in args[1]
to control the formatting of args[2..$], and write the resulting string to
args[0]. If arg[0] is not a FILE*, the call is equivalent to writef(stdout,
args)."

However, this program

import std.stdio;
void main() {
        writef(stderr.getFP(), "hi");
}

fails to compile with the error

/usr/include/d/std/stdio.d(1756): Error: template std.stdio.File.writef does
not match any function template declaration. Candidates are:
/usr/include/d/std/stdio.d(752):        std.stdio.File.writef(Char, A...)(in
Char[] fmt, A args)
/usr/include/d/std/stdio.d(1756): Error: template std.stdio.File.writef(Char,
A...)(in Char[] fmt, A args) cannot deduce template function from argument
types !()(shared(_iobuf)*,string)
test.d(5): Error: template instance std.stdio.writef!(shared(_iobuf)*,string)
error instantiating
z

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


More information about the Digitalmars-d-bugs mailing list