issue with static foreach

jfondren julian.fondren at gmail.com
Thu Jul 22 05:57:02 UTC 2021


On Thursday, 22 July 2021 at 03:43:44 UTC, someone wrote:
> ... it compiles no-more: Error: found `End of File` when 
> expecting `}` following compound statement
>
> ... what I am doing wrong ?

You'll get the same error from this code:

```d
unittest {
     mixin("{");
     mixin("}");
}
```

https://dlang.org/spec/statement.html#mixin-statement

>The text contents of the string must be compilable as a valid 
>StatementList, and is compiled as such.

Each individual string has to compile on its own. You'll have to 
concatenate strings and then mixin them.


More information about the Digitalmars-d-learn mailing list