Shadowing of members

Michael pr at m1xa.com
Sun Jan 20 08:08:09 PST 2013


On Wednesday, 16 January 2013 at 12:23:51 UTC, Andrey wrote:
>> 	class B {
>> 		protected int a=123;
>> 	}
>>
>> 	class A : B {
>> 		int f(int b) {
>> 			//int a;	// <--- I forgot to write this line
>> 			...
>> 			a = b + 1;	// <---  Oops!
>> 			...
>> 			return a;
>> 		}
>> 	}
>
> That's why I don't understand, why D allows to refer to member 
> variables and functions without "this". I always use "this" and 
> don't have any problems.

this.because(this.does(this.not(this.make(this.sense()))));

or because().it().is().have().sense();

about subject: name convention - good code.


More information about the Digitalmars-d mailing list