546 – Error message for accessing a deprecated variable is doubled

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 546 - Error message for accessing a deprecated variable is doubled
Summary: Error message for accessing a deprecated variable is doubled
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 trivial
Assignee: Walter Bright
URL:
Keywords: diagnostic, patch
Depends on: 547
Blocks:
Show dependency tree / graph
Reported: 2006年11月17日 14:05 UTC by Stewart Gordon
Modified: 2014年02月15日 13:21 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Stewart Gordon 2006年11月17日 14:05:16 UTC
----------
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 Stewart Gordon 2007年12月06日 14:53:55 UTC
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 Walter Bright 2008年06月29日 19:10:00 UTC
I marked this as trivial because it is cosmetic only.
Comment 3 yebblies 2011年06月30日 08:17:47 UTC
This patch fixes all the test cases in this report.
https://github.com/D-Programming-Language/dmd/pull/183 


AltStyle によって変換されたページ (->オリジナル) /