The following, will not compile ``` struct S { int i; } void main() { S s = mixin(`{1}`); } ``` Error: found } when expecting ; following statement app.d-mixin-8(8): Error: found End of File when expecting } following compound statement But this will compile: ``` struct S { int i; } void main() { S s = mixin(`S(1)`); } ``` I think the initializer should compile, as array initializers are allowed in the mixin, for example this works: ``` struct S { int i; } void main() { S[] s = mixin(`[S(1), S(2)]`); } ```
arrays work but not in the path you think it actually does. auto a = mixin("[0]"); gives an "ExpInitializer" made of a "MixinExpression", which contains some code for a "PrimaryExp" that's a "ArrayLiteral". S s = mixin("{0}"); Is rejected because "StructInitializer" is not a primary exp. When can see then that the requested feature is then part of a bigger project, that if done, handles also this specific case. *** This issue has been marked as a duplicate of issue 15692 ***