https://issues.dlang.org/show_bug.cgi?id=19779
Issue ID: 19779
Summary: `assert`ions evaluate in CTFE do not print `char[]`
arrays as strings
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Example:
int test(int x)
{
const char[3] msg = ['a', 'b', 'c'];
assert(false, msg);
return x;
}
void main()
{
// This statement incorrectly displays
// Error: ['a', 'b', 'c'][0..3]
enum x = test(1);
// At runtime, however, it correctly displays
// [email protected](5): abc
auto y = test(1);
}
I expect `enum x test(1)` to display "abc" instead of "['a', 'b', 'c'][0..3]"
--