Bug 546 – Error message for accessing a deprecated variable is doubled

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2006-11-17T14:05:00Z
Last change time
2014-02-15T13:21:47Z
Keywords
diagnostic, patch
Assigned to
bugzilla
Creator
smjg
Depends on
547

Comments

Comment #0 by smjg — 2006-11-17T14:05:16Z
---------- 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.
Comment #3 by yebblies — 2011-06-30T08:17:47Z
This patch fixes all the test cases in this report. https://github.com/D-Programming-Language/dmd/pull/183
Comment #4 by bugzilla — 2011-10-08T20:46:38Z