Nesting static foreach and using enum has latent problem.

static foreach()
  static foreach()
  {
     enum A = ;
  }

compiler complains because A is defined multiple times by the outer most foreach.

To fix this

static foreach()
  static foreach()
  {
     {
        enum A = ;
     }
  }

But then compiler complains about unexpected { if in a scope where normal {}'s are not expected.

So there is no way out of this conundrum? Maybe we need static {}?




Reply via email to