Bug 547 – Accessing a deprecated member variable through an explicit object reference 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:05:00Z
Last change time
2014-02-15T13:20:41Z
Keywords
accepts-invalid
Assigned to
bugzilla
Creator
smjg
Blocks
546

Comments

Comment #0 by smjg — 2006-11-17T14:05:56Z
The following code accesses the deprecated members of the class in different ways. The body of the function test thus contains no legal statement (if compiling without -d) but nonetheless compiles without error. ---------- import std.stdio; class ClassWithDeps { deprecated int value; deprecated static int staticValue; void test(ClassWithDeps obj) { obj.value = 666; obj.staticValue = 102; this.value = 666; this.staticValue = 103; ClassWithDeps.staticValue = 104; writefln(obj.value); writefln(obj.staticValue); writefln(this.value); writefln(this.staticValue); writefln(ClassWithDeps.staticValue); } } ---------- The same happens if a struct or union is used instead of a class.
Comment #1 by bugzilla — 2008-07-09T22:34:47Z
Fixed dmd 1.032 and 2.016