Bug 19779 – `assert`ions evaluated in CTFE do not print `char[]` arrays as strings

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-03-31T05:44:44Z
Last change time
2024-12-13T19:02:46Z
Assigned to
No Owner
Creator
Mike Franklin
Moved to GitHub: dmd#19548 →

Comments

Comment #0 by slavo5150 — 2019-03-31T05:44:44Z
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]"
Comment #1 by robert.schadek — 2024-12-13T19:02:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19548 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB