gcc/testsuite/gdc.test/compilable/b20938.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=20938 |
| 2 | // Cannot create const arrays mixing immutable and mutable structs with indirections |
| 3 | struct S { int[] a; } |
| 4 | enum A { a } |
| 5 | enum B { b } |
| 6 | |
| 7 | void fun() { |
| 8 | int* pi; |
| 9 | immutable int* ipi; |
| 10 | int[] ai; |
| 11 | immutable int[] iai; |
| 12 | S s; |
| 13 | immutable S _is; |
| 14 | Object o; |
| 15 | immutable Object io; |
| 16 | |
| 17 | auto a = [pi, ipi]; |
| 18 | auto b = [ai, iai]; |
| 19 | auto c = [s, _is]; |
| 20 | auto d = [o, io]; |
| 21 | |
| 22 | auto e = [A.a, B.b]; |
| 23 | } |