Bug 18689 – std.format should always throw FormatException on bad specs/arguments

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-03-28T16:02:17Z
Last change time
2018-03-30T09:49:20Z
Assigned to
No Owner
Creator
Jack Stouffer

Comments

Comment #0 by jack — 2018-03-28T16:02:17Z
void main() { import std.exception : assertThrown; import std.format : format, FormatException; assertThrown!FormatException(format("%d", "foo")); // fails }
Comment #1 by github-bugzilla — 2018-03-30T09:49:20Z
Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/e2d791bcf1c2a129ec988589b7cabc9c65721dde Fix Issue 18689 - std.format should throw FormatException on bad format spec