February 22, 2005 mixin and const initializer | ||||
---|---|---|---|---|
| ||||
<code> template T() { int x; } struct S { mixin T; } void main() { const S s = { x:0 }; } </code> When compiling, DMD 0.113 outputs: Error: 'x' is not a member of 'S' But if remove 'mixin T' line, and insert instead 'int x', program compiles successfully. |
March 11, 2005 Re: mixin and const initializer | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Zaitseff Attachments: | Ilya Zaitseff wrote: | <code> | template T() | { | int x; | } | | struct S | { | mixin T; | } | | void main() | { | const S s = { x:0 }; | } | </code> | | When compiling, DMD 0.113 outputs: | Error: 'x' is not a member of 'S' | | But if remove 'mixin T' line, and insert instead 'int x', program | compiles successfully. Added to DStress as http://dstress.kuehne.cn/run/mixin_05.d http://dstress.kuehne.cn/run/mixin_06.d Thomas |
Copyright © 1999-2021 by the D Language Foundation