D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20236 - spurious deprecation warnings on function calls within with(X) blocks while X has a deprecated alias this target
Summary: spurious deprecation warnings on function calls within with(X) blocks while X...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-09-22 02:25 UTC by elpenguino+D
Modified: 2021-12-12 08:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description elpenguino+D 2019-09-22 02:25:05 UTC
```
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 Dlang Bot 2021-12-07 14:23:29 UTC
@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 Dlang Bot 2021-12-12 08:09:09 UTC
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