Constructor params with same name as members

Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 22 23:17:04 PDT 2014


Oh OK here it is:
http://dlang.org/deprecate.html#Variable%20shadowing%20inside%20functions

But it says "it is an error to use the feature" by 2.061 and I'm using 2.066!

Doesn't the scope of that deprecation cover struct members too? In
general it should be like "variables in inner scopes should not shadow
those in outer scopes" irrespective of what the scopes are, right?

Of course, for clarity we could add "except when the inner scope is a
separate namespace", so it is made clear that enum/struct/class
members do not shadow outer variables...


-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा



More information about the Digitalmars-d-learn mailing list