Bug 20236 – spurious deprecation warnings on function calls within with(X) blocks while X has a deprecated alias this target

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-09-22T02:25:05Z
Last change time
2021-12-12T08:09:09Z
Keywords
pull
Assigned to
No Owner
Creator
elpenguino+D

Comments

Comment #0 by elpenguino+D — 2019-09-22T02:25:05Z
``` 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.
Comment #1 by dlang-bot — 2021-12-07T14:23:29Z
@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
Comment #2 by dlang-bot — 2021-12-12T08:09:09Z
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