Bug 5065 – writefln("%f" of a Tuple prints a result
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-10-16T16:55:00Z
Last change time
2013-02-12T11:08:52Z
Keywords
accepts-invalid
Assigned to
andrej.mitrovich
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2010-10-16T16:55:11Z
import std.stdio: writefln;
import std.typecons: Tuple;
void main() {
writefln("%f", (Tuple!(int)).init);
}
Compiled with DMD 2.049 prints at runtime:
Prints: Tuple!(int)(0)
But I expect a compile-time error for the mismatch of the format string (and if that's not possible because the D compiler doesn't perform this basic test at compile-time, at run-time).
writefln() probably needs more unittests.
Comment #1 by andrej.mitrovich — 2013-01-18T18:03:24Z