[Issue 5065] New: writefln("%f" of a Tuple prints a result

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 16 16:55:46 PDT 2010


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

           Summary: writefln("%f"  of a Tuple prints a result
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          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-10-16 16:55:11 PDT ---
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.

-- 
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