Bug 17672 – Example from std.format throws exceptions

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2017-07-20T10:23:00Z
Last change time
2017-07-20T11:48:24Z
Assigned to
nobody
Creator
al.iv.korn

Comments

Comment #0 by al.iv.korn — 2017-07-20T10:23:55Z
Examples: writeln(format("%,d", 1000)); // "1,000" writeln(format("%,f", 1234567.891011)); // "1,234,567.891,011" writeln(format("%,?d", '?', 1000)); // "1?000" writeln(format("%,1d", 1000)); // "1,0,0,0" writeln(format("%,*d", 4, -12345)); // "-1,2345" writeln(format("%,*?d", 4, '_', -12345)); // "-1_2345" writeln(format("%,6?d", '_', -12345678)); // "-12_345678" assert(format("%12,3.3f", 1234.5678) == " 1,234.568", "'" ~ format("%12,3.3f", 1234.5678) ~ "'"); from https://dlang.org/phobos/std_format.html throws exceptions. E.g.: std.format.FormatException@/dlang/dmd/linux/bin64/../../src/phobos/std/format.d(1744): integral
Comment #1 by greensunny12 — 2017-07-20T11:48:24Z
Thanks a lot for reporting this issue. We do have a pipeline in place, s.t. all runnable examples are automatically checked: http://dlang.org/blog/2017/03/08/editable-and-runnable-doc-examples-on-dlang-org However, in this case the example changed from 2.074.0 to 2.075.0 as a new feature ws introduced and the daily cron to update the backend didn't run yet. I manually updated it now and everything works again: Run the example: https://is.gd/b3UxtJ See the change that introduced it for 2.075.0: https://github.com/dlang/phobos/commit/cc8eff102f4ddcf15c4def1a5b87786c3040689d