gcc/testsuite/gdc.test/fail_compilation/fail9290.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail9290.d(15): Error: slice `s1[]` is not mutable, struct `S` has immutable members |
| 5 | fail_compilation/fail9290.d(16): Error: array `s1` is not mutable, struct `S` has immutable members |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | struct S { immutable int i; } |
| 10 | |
| 11 | void main() |
| 12 | { |
| 13 | S[1] s1 = S(1); |
| 14 | S[1] s2 = S(2); |
| 15 | s1 = S(3); |
| 16 | s1 = s2; |
| 17 | } |