Comment #0 by default_357-line — 2018-04-18T14:17:52Z
Consider the following code:
struct Foo { }
struct Bar {
deprecated
@property Foo foo() { assert(false); return Foo.init; }
alias foo this;
}
void test(Bar bar) { }
void main()
{
Bar bar;
bar.test;
}
bar.test will be satisfied via UFCS as test(bar). However, DMD first tries to find test in Bar, and hence via alias this in the deprecated property access to foo. It does not end up using the property access - but it still reports the deprecated warning on the property!
Comment #1 by ag0aep6g — 2018-04-19T05:28:28Z
This probably has the same root cause as issue 12807.
Comment #2 by default_357-line — 2018-04-19T10:52:19Z
Same piece of code, at least.
Comment #3 by github-bugzilla — 2018-04-23T07:55:42Z