Mercurial > projects > ldc
diff tests/mini/bug198_ctfestructinit.d @ 913:29c0d1194033
Fix #198 and #199 by making CTFE on static struct initializers work.
Renamed SymbolDeclaration to StaticStructInitDeclaration to make its usage clearer.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 01 Feb 2009 20:20:56 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/mini/bug198_ctfestructinit.d Sun Feb 01 20:20:56 2009 +0100 @@ -0,0 +1,12 @@ +struct Color { + uint c; + static Color opCall(uint _c) { Color ret; ret.c = _c; return ret; } +} + +// run at compile time +static const Color white = Color(0xffffffff); + +void main() +{ + assert(white.c == 0xffffffff); +}