www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Some deprecation errors are doubled

Using DMD 0.120, Windows 98SE.

Either I'm going down with diplopia, or the compiler has a habit of 
printing certain deprecation error messages twice.

As you see, they are:

- Accessing a variable directly within its scope, be it global or a 
static or non-static member
- Calling a constructor or static member of a deprecated class

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

deprecated class DepClass {
     int value;
     this() { value = 42; }
     void print() { writefln(value); }
     static int staticValue;
     static void printSomething() { writefln("Something"); }
}

class ClassWithDeps {
     deprecated int value;
     deprecated static int staticValue;
     void test(ClassWithDeps obj) {
         value = 666;  // first error
         staticValue = value;
         writef(staticValue);
     }
}

deprecated int globalValue;

void main() {
     DepClass depObject;
     depObject = new DepClass;
     DepClass.printSomething();
     DepClass.staticValue = 105;
     globalValue = DepClass.staticValue;
     writef(globalValue);
}
----------
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(15): variable 
dep3s.ClassWithDeps.value is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(15): variable 
dep3s.ClassWithDeps.value is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(16): variable 
dep3s.ClassWithDeps.staticValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(16): variable 
dep3s.ClassWithDeps.staticValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(16): variable 
dep3s.ClassWithDeps.value is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(16): variable 
dep3s.ClassWithDeps.value is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(17): variable 
dep3s.ClassWithDeps.staticValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(17): variable 
dep3s.ClassWithDeps.staticValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(24): class 
dep3s.DepClass is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(25): class 
dep3s.DepClass is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(25): constructor 
dep3s.DepClass.this is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(26): class 
dep3s.DepClass is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(26): class 
dep3s.DepClass is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(26): function 
dep3s.DepClass.printSomething is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(27): class 
dep3s.DepClass is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(27): class 
dep3s.DepClass is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(28): variable 
dep3s.globalValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(28): variable 
dep3s.globalValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(28): class 
dep3s.DepClass is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(28): class 
dep3s.DepClass is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(29): variable 
dep3s.globalValue is deprecated
D:\My Documents\Programming\D\Tests\bugs\dep3s.d(29): variable 
dep3s.globalValue is deprecated
----------

Just look at the length of the errors compared to the length of the code!

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on 
the 'group where everyone may benefit.
Apr 08 2005