Bug 549 – A class derived from a deprecated class is not caught
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-17T14:36:00Z
Last change time
2014-02-15T13:20:19Z
Keywords
accepts-invalid
Assigned to
bugzilla
Creator
smjg
Comments
Comment #0 by smjg — 2006-11-17T14:36:19Z
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();
}
----------