Fix bugzilla 24845 - Compiler error when trying to assign to an AA value of an enum instance

This commit is contained in:
Dennis Korpel 2024-11-25 13:20:46 +01:00 committed by The Dlang Bot
parent 949cb11c41
commit 519d388498
3 changed files with 9 additions and 6 deletions

View file

@ -4143,10 +4143,9 @@ extern (C++) final class IndexExp : BinExp
override bool isLvalue()
{
if (e1.op == EXP.assocArrayLiteral)
return false;
if (e1.type.ty == Tsarray ||
(e1.op == EXP.index && e1.type.ty != Tarray))
auto t1b = e1.type.toBasetype();
if (t1b.isTypeAArray() || t1b.isTypeSArray() ||
(e1.isIndexExp() && t1b != t1b.isTypeDArray()))
{
return e1.isLvalue();
}