From 6a7772857808265e44b6d380acd0b7db55fb5602 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 23 Apr 2011 17:40:23 +0200 Subject: [PATCH] Merged DMD commit 2b51411e9e8b7ca3e62747ffb6f96c94089cebcc: 4389 ICE(constfold.c) or wrong code: string~=dchar in CTFE Was failing on D1 because dchar, wchar implicitly convert to char, even if they don't fit. So we need to check for array~char BEFORE we check for implicit conversion. --- dmd/expression.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dmd/expression.c b/dmd/expression.c index 5a7ef295..467fb267 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -8609,14 +8609,6 @@ Expression *CatAssignExp::semantic(Scope *sc) e2 = e2->castTo(sc, e1->type); type = e1->type; e = this; - } - else if ((tb1->ty == Tarray) && - e2->implicitConvTo(tb1next) - ) - { // Append element - e2 = e2->castTo(sc, tb1next); - type = e1->type; - e = this; // Reenable when _d_arrayappendwd and cd are in the runtime. /* } @@ -8633,6 +8625,14 @@ Expression *CatAssignExp::semantic(Scope *sc) * to be a surrogate pair, nothing good can result. */ } + else if ((tb1->ty == Tarray) && + e2->implicitConvTo(tb1next) + ) + { // Append element + e2 = e2->castTo(sc, tb1next); + type = e1->type; + e = this; + } else { if (tb1 != Type::terror && tb2 != Type::terror)