On Sunday, 24 November 2013 at 14:50:28 UTC, Maxim Fomin wrote:
This is identifiers shadowing issue. In best case you could not define boolean f, so the problem would not arise in a first place.
Yes, I agree that it's also can be identifiers shadowing issue. But we allow code like this:
class Foo { int i; this(int i) { this.i = i; } }
Anyway, many artifical examples can be provided which shows that some features behave in unexpected ways which is not a reason that they are bad.
I repeat, this is REAL LIFE example. I just reduce it because it have unnecessary details for this case.