https://issues.dlang.org/show_bug.cgi?id=21674
--- Comment #7 from Iain Buclaw <[email protected]> --- The cause of the regression is that the conditions that check this are looking at the wrong thing. --- if (Expression result = checkAliasThisForLhs(ad1, sc, e)) { // Problem #1 // + e = `m.data = "Hello World"` // + result = `m.data.str("Hello World") // I think we should instead be looking at the `result{.e1}.op`, not the // original expression. if (e.op != EXP.assign || e.e1.op == EXP.type) return result; // Problem #2 // + ad1 = `S1` // + result.var.parent = `EntryType` // I think we should instead be looking at the aggregate declaration for // the LHS of the rewritten `result`. if (ad1.fields.dim == 1 || (ad1.fields.dim == 2 && ad1.vthis)) { if (var && var.type == ad1.fields[0].type) return result; if (tf.isref && ad1.fields[0].type == tf.next) return result; } } --- --
