comparison 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
comparison
equal deleted inserted replaced
912:16264a3973bf 913:29c0d1194033
1 struct Color {
2 uint c;
3 static Color opCall(uint _c) { Color ret; ret.c = _c; return ret; }
4 }
5
6 // run at compile time
7 static const Color white = Color(0xffffffff);
8
9 void main()
10 {
11 assert(white.c == 0xffffffff);
12 }