September 10, 2018 [Issue 19237] New: string mixin struct initializer doesn't compile | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19237 Issue ID: 19237 Summary: string mixin struct initializer doesn't compile Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: radu.racariu@gmail.com 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)]`); } ``` -- |
Copyright © 1999-2021 by the D Language Foundation