Consider the following code: struct Bla { deprecated("bla") int get() { return 5; } alias get this; } void main() { Bla[] blaArray; blaArray ~= Bla(); } There is no reason that appending to Bla[] should justify an access to the deprecated get() function. And yet, when compiled with `-de`, `blaArray ~= Bla()` errors with a deprecation error. Note that this does not happen with `blaArray ~ Bla()`.
Oh, and it's a regression too (since 2.084.1).
@FeepingCreature created dlang/dmd pull request #9953 "Fix issue 19936: `alias deprecated get this` falsely triggers deprecation on `array ~=`" fixing this issue: - Fix issue 19936: don't attempt alias-this for the rhs of an opAppend overload if no applicable overload was found in the lhs. https://github.com/dlang/dmd/pull/9953
dlang/dmd pull request #9953 "[REG 2.084.1] Fix issue 19936: `alias deprecated get this` falsely triggers deprecation on `array ~=`" was merged into stable: - 1885840b3151eae627a2127d055437b2ea2ac357 by Mathis Beer: Fix issue 19936: don't attempt alias-this for the rhs of an opAppend overload if no applicable overload was found in the lhs https://github.com/dlang/dmd/pull/9953