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.
This commit is contained in:
David Nadlinger
2011-04-23 17:40:23 +02:00
parent 625fe5a61d
commit 6a77728578

View File

@@ -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)