Bug 2918 – stdio.d(511): Error: cannot deduce template function from argument types !()(LockingTextWriter,uint)
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-05-02T02:42:00Z
Last change time
2015-06-09T01:26:26Z
Assigned to
andrei
Creator
someanon
Comments
Comment #0 by someanon — 2009-05-02T02:42:58Z
$ cat xor.d
import std.random;
import std.stdio;
int main() {
Random r = Random();
writefln(r.front);
return 0;
}
$ dmd xor.d
/dmd/linux/bin/../../src/phobos/std/stdio.d(511): Error: template std.format.formattedWrite(Writer,F,A...) does not match any function template declaration
/dmd/linux/bin/../../src/phobos/std/stdio.d(511): Error: template std.format.formattedWrite(Writer,F,A...) cannot deduce template function from argument types !()(LockingTextWriter,uint)
Comment #1 by rsinfu — 2010-06-22T20:47:28Z
The bug is already fixed -- recent Phobos generates following error message for your testcase:
Error: static assert "You must pass a formatting string as the first argument to writef or writefln. If no formatting is needed, you may want to use write or writeln."