March 31, 2019 [Issue 19779] New: `assert`ions evaluate in CTFE do not print `char[]` arrays as strings | ||||
---|---|---|---|---|
| ||||
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: nobody@puremagic.com Reporter: slavo5150@yahoo.com 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 // core.exception.AssertError@ladder.d(5): abc auto y = test(1); } I expect `enum x test(1)` to display "abc" instead of "['a', 'b', 'c'][0..3]" -- |
Copyright © 1999-2021 by the D Language Foundation