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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 10 23:23:03 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10989



--- Comment #1 from Don <clugdbug at yahoo.com.au> 2013-09-10 23:23:00 PDT ---
Patch:

--- a/src/ctfeexpr.c
+++ b/src/ctfeexpr.c
@@ -157,7 +157,7 @@ char *ThrownExceptionExp::toChars()
 void ThrownExceptionExp::generateUncaughtError()
 {
     thrown->error("Uncaught CTFE exception %s(%s)", thrown->type->toChars(),
-        (*thrown->value->elements)[0]->toChars());
+        (*thrown->value->elements)[0]->toString()->toChars());
     /* Also give the line where the throw statement was. We won't have it
      * in the case where the ThrowStatement is generated inter


Reduced test case:

enum foo = () { throw new Exception(['a', 'b', 'c']); return 0; }();

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list