Bug 14277 – Compile-time array casting error - ugly error report

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-03-11T19:38:13Z
Last change time
2022-02-14T19:56:38Z
Keywords
pull
Assigned to
No Owner
Creator
Daniel Čejchan

Attachments

IDFilenameSummaryContent-TypeSize
1491fix_14277.patchtrim output of long expressionstext/plain1152

Comments

Comment #0 by czdanol — 2015-03-11T19:38:13Z
Hey, look at this code: http://dpaste.dzfl.pl/ce4c5230ac18 If not working:: static ubyte[] u = new char[9999]; The error report is kinda ugly, isn't it?
Comment #1 by ketmar — 2015-03-11T20:52:54Z
wow! i like it! no, really, it's cute!
Comment #2 by ketmar — 2015-03-12T17:21:00Z
Created attachment 1491 trim output of long expressions as far as i know, `Expression::toChars()` is not using in anything vital, only in diagnostic output. so i trimming it's result to arbitrary limit of 200 chars. maybe it's better to fix array literal output, but this is easier, and it will additionaly limit output of other long expressions, which are unreadable anyway if they reaches that size.
Comment #3 by ketmar — 2015-03-12T17:22:26Z
p.s. this can ruing long utf-8 literals, though. not that i really care.
Comment #4 by ketmar — 2015-04-29T16:12:32Z
this also ruing things like `typeof(smth).stringof[$-2..$] == "[]"` for example. so it's unusable.
Comment #5 by dlang-bot — 2022-02-14T15:41:51Z
@RazvanN7 created dlang/dmd pull request #13651 "Fix Issue 14277 - Compile-time array casting error - ugly error report" fixing this issue: - Fix Issue 14277 - Compile-time array casting error - ugly error report https://github.com/dlang/dmd/pull/13651
Comment #6 by dlang-bot — 2022-02-14T19:56:38Z
dlang/dmd pull request #13651 "Fix Issue 14277 - Compile-time array casting error - ugly error report" was merged into master: - f08f9c1df2a8b49d2a7245f3c518653bf4b21a5d by RazvanN7: Fix Issue 14277 - Compile-time array casting error - ugly error report https://github.com/dlang/dmd/pull/13651