On Sunday, 2 September 2018 at 13:21:05 UTC, bauss wrote:
Is there a reason why you cannot create a separate scope within a static foreach?

The below will not compile:

```
enum a = ["a" : "a", "b" : "b", "c" : "c"];

static foreach (k,v; a)
{
    {
        enum b = k;
        enum c = v;
    }
}
```

It works if it's in a function of course.
[...]

At the global scope it cant work since there even block statements are not possible, just this

```
{
    enum b = 0;
    enum c = 0;
}
```

doesn't compile; and this is what you tried to add in the `static foreach` body. So if i understand correctly this is even not a `static foreach` issue here.

Reply via email to