When not capturing the return value of a string mixin expression, I get "found `End of File` when expecting `;`"

realhet real_het at hotmail.com
Fri Sep 12 15:41:15 UTC 2025


On Friday, 12 September 2025 at 15:28:58 UTC, Monkyyy wrote:
> On Friday, 12 September 2025 at 08:36:42 UTC, realhet wrote:
>> Hi,
>>
>> ```d
>> import std;
>>
>> [...]
>
> It's seeing the eof of the mix file no?

This is the smallest example so far:
```d
import std;

void main() {
   (   mixin("(()=>1)()")  ); //it compiles and runs.
     mixin("(()=>1)()")   ;  //Error: onlineapp.d-mixin-5(5): 
Error: found `End of File` when expecting `;` following expression
}
```

What I learned today is that the second mixin wants a statement 
and does not accept an expression. It didn't liked the EOF which 
is appeared at the end of the mixin text.


More information about the Digitalmars-d-learn mailing list