d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test12385.d
blobcbba723fe7490c53ed0d0a4dcdae5c79b7e91560
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/test12385.d(29): Error: cannot modify `immutable` expression `unbundled.x`
5 ---
6 */
8 // https://issues.dlang.org/show_bug.cgi?id=12385
10 class BundledState
12 string m_State;
14 int x = 3;
16 this(string state) immutable
18 m_State = state;
22 enum States : immutable(BundledState)
24 unbundled = new immutable BundledState("bla"),
27 void main()
29 States.unbundled.x = 6; // Modifies x.