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
Comment #2 by bearophile_hugs — 2013-01-19T01:00:31Z
Comment #3 by github-bugzilla — 2013-01-20T04:50:34Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d6d12ffdc8044937fb206b9c2b2e8965792e2fef Fixes Issue 5065 - Format specifier must be %s for types which don't implement toString with a format specifier. https://github.com/D-Programming-Language/phobos/commit/e9cb971002888fba4e9ca051f9e8ff999dd6923d Merge pull request #1079 from AndrejMitrovic/Fix5065 Issue 5065 - Format specifier must be '%s' for some types
Comment #4 by github-bugzilla — 2013-02-11T12:20:24Z
Commits pushed to staging at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d6d12ffdc8044937fb206b9c2b2e8965792e2fef Fixes Issue 5065 - Format specifier must be %s for types which don't implement toString with a format specifier. https://github.com/D-Programming-Language/phobos/commit/e9cb971002888fba4e9ca051f9e8ff999dd6923d Merge pull request #1079 from AndrejMitrovic/Fix5065
Comment #5 by github-bugzilla — 2013-02-11T23:13:23Z
Commits pushed to https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d6d12ffdc8044937fb206b9c2b2e8965792e2fef Fixes Issue 5065 - Format specifier must be %s for types which don't implement toString with a format specifier. https://github.com/D-Programming-Language/phobos/commit/e9cb971002888fba4e9ca051f9e8ff999dd6923d Merge pull request #1079 from AndrejMitrovic/Fix5065
Comment #6 by andrej.mitrovich — 2013-02-12T11:08:52Z
How many notifications are we going to receive for every fixed bug? ..