September 22, 2019
https://issues.dlang.org/show_bug.cgi?id=20236

          Issue ID: 20236
           Summary: spurious deprecation warnings on function calls within
                    with(X) blocks while X has a deprecated alias this
                    target
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: elpenguino+D@gmail.com

```
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.

--