[Issue 4629] New: BufferedFile.printf() wants char[] as first argument
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Aug 11 19:38:31 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4629
Summary: BufferedFile.printf() wants char[] as first argument
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-08-11 19:38:30 PDT ---
Using dmd 2.048 on this code:
import std.stream: BufferedFile, FileMode;
void main() {
auto f = new BufferedFile("testfile.t", FileMode.Out);
f.printf("%d\n", 10);
f.close();
}
It shows the errors:
test.d(4): Error: function std.stream.Stream.printf (char[] format,...) is not
callable using argument types (string,int)
test.d(4): Error: cannot implicitly convert expression ("%d\x0a") of type
string to char[]
This gives no errors:
f.printf(cast(char[])"%d\n", 10);
--
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