Seems to be working just fine as of 2.098.

```d
import std;
void main()
{
    static foreach(Foo; ["Abc", "def"]) {{
        string str = Foo;
        writeln("Hello D ", str, __VERSION__);
    }}
}
```

```
Hello D Abc2098
Hello D def2098
```

Anyway, AliasAssign has nothing to do with this. This "trick" creates a closure aka ``() { ... }``. Thats all its doing.

From the AST dump:

```
import object;
import std;
void main()
{
        {
                string str = "Abc";
                writeln("Hello D ", str, 2098L);
        }
        {
                string str = "def";
                writeln("Hello D ", str, 2098L);
        }
        return 0;
}
```

Reply via email to