[Issue 21916] New: Error message is obfuscated when using wrong format specifier at compile-time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed May 12 22:56:16 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21916
Issue ID: 21916
Summary: Error message is obfuscated when using wrong format
specifier at compile-time
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: diagnostic
Severity: minor
Priority: P4
Component: phobos
Assignee: nobody at puremagic.com
Reporter: dlang-bugzilla at thecybershadow.net
/////// 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
--
More information about the Digitalmars-d-bugs
mailing list