dmd icon indicating copy to clipboard operation
dmd copied to clipboard

[Enhancement] Unary operator assignment

Open Bolpat opened this issue 2 months ago • 0 comments

Introduce opUnaryAssign with parameter to hook assignment syntax. In particular, that’s useful for opUnaryAssign(string op : "*")(T rhs) so that the dereference operator need not return by reference to be assignable,

Essentially, if *lhs = rhs cannot be lowered to lhs.opUnary!"*"() = rhs, lower it to lhs.opUnaryAssign!"*"(rhs).

Bolpat avatar Oct 17 '25 00:10 Bolpat