www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18775] New: DMD falsely reports deprecation for deprecated

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 puremagic.com
          Reporter: default_357-line 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!

--
Apr 18 2018