[Issue 10989] [CTFE] Uncaught exception messages are not pretty printed if message wasn't literal

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 5 05:35:34 PST 2015


https://issues.dlang.org/show_bug.cgi?id=10989

sinkuupump at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sinkuupump at gmail.com

--- Comment #5 from sinkuupump at gmail.com ---
I dustmited the test case, and found the cause inside the std.array.Appender.
https://gist.githubusercontent.com/sinkuu/7ee9db68c3229d075a6f/raw/fd1e241428c0ade08e8214e512486d5e0071c2cb/gistfile1.d


Reduced test case:

enum foo = {
    string msg = "Something 42 wicked happened!";

    char[] arr;
    arr.length = msg.length;
    arr = arr[0 .. $];
    arr[] = msg;

    throw new Exception(cast(string)arr);
    return 0;
}();

--


More information about the Digitalmars-d-bugs mailing list