gcc/testsuite/gdc.test/fail_compilation/ice13644.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/ice13644.d(22): Error: foreach: key cannot be of non-integral type `string` |
| 5 | --- |
| 6 | */ |
| 7 | |
| 8 | struct Tuple(T...) |
| 9 | { |
| 10 | T field; |
| 11 | alias field this; |
| 12 | } |
| 13 | |
| 14 | Tuple!(string, string)[] foo() |
| 15 | { |
| 16 | Tuple!(string, string)[] res; |
| 17 | return res; |
| 18 | } |
| 19 | |
| 20 | void main() |
| 21 | { |
| 22 | foreach (string k2, string v2; foo()) |
| 23 | { |
| 24 | } |
| 25 | } |