Bug 21916 – Error message is obfuscated when using wrong format specifier at compile-time

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-12T22:56:16Z
Last change time
2021-05-13T00:22:33Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2021-05-12T22:56:16Z
/////// test.d ////// import std.format; void main() { format!"%f"([1]); } ///////////////////// Currently produces: .../std/format/package.d(748): Error: expression `FormatException(['I', 'n', 'c', 'o', 'r', 'r', 'e', 'c', 't', ' ', 'f', 'o', 'r', 'm', 'a', 't', ' ', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', ' ', 'f', 'o', 'r', ' ', 'r', 'a', 'n', 'g', 'e', ':', ' ', '%', 'f'], ".../std/format/internal/write.d", 1722LU, null, null, 0u)` is not constant .../std/format/package.d(1370): while evaluating: `static assert(!e)` test.d(5): Error: template instance `std.format.format!("%f", int[])` error instantiating
Comment #1 by dlang-bot — 2021-05-12T22:59:02Z
@CyberShadow created dlang/phobos pull request #8070 "Fix Issue 21916 - Error message is obfuscated when using wrong format…" fixing this issue: - Fix Issue 21916 - Error message is obfuscated when using wrong format specifier at compile-time https://github.com/dlang/phobos/pull/8070
Comment #2 by dlang-bot — 2021-05-13T00:22:33Z
dlang/phobos pull request #8070 "Fix Issue 21916 - Error message is obfuscated when using wrong format…" was merged into master: - c2337fcad8ccb291d59bb42d3aeda3929f4e7063 by Vladimir Panteleev: Fix Issue 21916 - Error message is obfuscated when using wrong format specifier at compile-time https://github.com/dlang/phobos/pull/8070