``` struct X { alias y this; deprecated int y() { return 5; } int x() { return 5; } } unittest { static void func(int) {} with(X.init) { func(x); } } ``` Since DMD 2.064, this code prints a deprecation warning despite y() never being called or otherwise used.
@RazvanN7 created dlang/dmd pull request #13397 "Fix Issue 20236 - spurious deprecation warnings on function calls wit…" fixing this issue: - Fix Issue 20236 - spurious deprecation warnings on function calls within with(X) blocks while X has a deprecated alias this target https://github.com/dlang/dmd/pull/13397
dlang/dmd pull request #13397 "Fix Issue 20236 - spurious deprecation warnings on function calls wit…" was merged into stable: - 388d8ea4eb1c11c1288ca569112795733960cd33 by RazvanN7: Fix Issue 20236 - spurious deprecation warnings on function calls within with(X) blocks while X has a deprecated alias this target https://github.com/dlang/dmd/pull/13397