[Issue 549] New: A class derived from a deprecated class is not caught

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 17 12:36:22 PST 2006


http://d.puremagic.com/issues/show_bug.cgi?id=549

           Summary: A class derived from a deprecated class is not caught
           Product: D
           Version: 0.174
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: smjg at iname.com


DMD allows you to derive a non-deprecated class from a deprecated class.  You
can even instantiate the derived class, and use it to access the deprecated
class's members, thereby bypassing the deprecation!

----------
import std.stdio;

deprecated class DepClass {
    void test() {
        writefln("Accessing what's deprecated!");
    }
}

class Derived : DepClass {}

void main() {
    Derived d = new Derived;
    d.test();
}
----------


-- 




More information about the Digitalmars-d-bugs mailing list