1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag12678.d(19): Error: const field 'cf1' initialized multiple times
5 fail_compilation/diag12678.d(22): Error: immutable field 'if1' initialized multiple times
6 fail_compilation/diag12678.d(25): Error: const field 'cf2' initialization is not allowed in loops or after labels
7 ---
8 */
9 
10 struct S
11 {
12     const int cf1;
13     const int cf2;
14     immutable int if1;
15 
thisS16     this(int x)
17     {
18         cf1 = x;
19         cf1 = x;
20 
21         if1 = x;
22         if1 = x;
23 
24         foreach (i; 0 .. 5)
25             cf2 = x;
26     }
27 }
28