[Issue 18775] New: DMD falsely reports deprecation for deprecated implicit casts that were not used in UFCS

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 18 14:17:52 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18775

          Issue ID: 18775
           Summary: DMD falsely reports deprecation for deprecated
                    implicit casts that were not used in UFCS
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de

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!

--


More information about the Digitalmars-d-bugs mailing list