"Peter Alexander" <[email protected]> wrote in message news:[email protected]... >> I dont know if it is, but IMO it really should be an error to declare >> local >> variables that hide member variables. > > I disagree. I always do that in constructors: > > int x, y; > this(int x, int y) > { > this.x = x; > this.y = y; > } > > I think you would annoy a lot of people if it was forbidden.
I'm sure it would. But i think the benefit would outweigh the cost. I mean the cost is coding style, personal preference, the benefit is fewer bugs. And people would get used to it.
