On 11/24/13 9:39 AM, bearophile wrote:
Are you saying this code gives or should give errors?


class Foo {}
class Bar {
      Foo f;
      void bar() {
          bool f = true;
          if (f) {}
      }
}
void main() {}

Sorry, I misread the example - thought it's a function local variable. I'm not sure whether shadowing globals or members would be a good idea. gcc has a -W flag for that, and someone tried to turn it on at Facebook but with debatable results. We ended up not using that warning.

Andrei

Reply via email to