----------
deprecated int x;
void main() {
x = 53;
int y = x;
}
----------
D:\My Documents\Programming\D\Tests\bugs\dep_var.d(4): variable dep_var.x is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_var.d(4): variable dep_var.x is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_var.d(5): variable dep_var.x is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_var.d(5): variable dep_var.x is deprecated
----------
The bug also shows if x is a member of a struct, class or union, but only if accessing from within it through the implicit this pointer:
----------
import std.stdio;
class ClassWithDeps {
deprecated int value;
deprecated static int staticValue;
void test(ClassWithDeps obj) {
value = 666;
staticValue = 101;
writefln(value);
writefln(staticValue);
}
}
----------
D:\My Documents\Programming\D\Tests\bugs\dep_memvar_double.d(8): variable dep_memvar_double.ClassWithDeps.value is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_memvar_double.d(8): variable dep_memvar_double.ClassWithDeps.value is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_memvar_double.d(9): variable dep_memvar_double.ClassWithDeps.staticValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_memvar_double.d(9): variable dep_memvar_double.ClassWithDeps.staticValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_memvar_double.d(10): variable dep_memvar_double.ClassWithDeps.value is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_memvar_double.d(10): variable dep_memvar_double.ClassWithDeps.value is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_memvar_double.d(11): variable dep_memvar_double.ClassWithDeps.staticValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep_memvar_double.d(11): variable dep_memvar_double.ClassWithDeps.staticValue is deprecated
----------
Comment #1 by smjg — 2007-12-06T14:53:55Z
For cases in which the member variable is accessed through an explicit object reference, bug 547 bites instead. When 547 is fixed, this one may affect these instances as well, so fixing that bug may be necessary to confirm that this one is fixed properly. Hence the dependency.
Comment #2 by bugzilla — 2008-06-29T19:10:00Z
I marked this as trivial because it is cosmetic only.