D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2918 - stdio.d(511): Error: cannot deduce template function from argument types !()(LockingTextWriter,uint)
Summary: stdio.d(511): Error: cannot deduce template function from argument types !()...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: Andrei Alexandrescu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-02 02:42 UTC by sa
Modified: 2015-06-09 01:26 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description sa 2009-05-02 02:42:58 UTC
$ 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 Shin Fujishiro 2010-06-22 20:47:28 UTC
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."