]>
Commit | Line | Data |
---|---|---|
7da827c9 IB |
1 | // https://issues.dlang.org/show_bug.cgi?id=7851 |
2 | /* | |
3 | TEST_OUTPUT: | |
4 | --- | |
5 | fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_0` of type `int` | |
6 | fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_1` of type `long` | |
7 | fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_2` of type `float` | |
8 | --- | |
9 | */ | |
b4c522fa IB |
10 | |
11 | ||
12 | template TypeTuple(TList...) | |
13 | { | |
14 | alias TList TypeTuple; | |
15 | } | |
16 | ||
17 | struct Tuple(Specs...) | |
18 | { | |
19 | TypeTuple!(int, long, float) mem; | |
20 | ||
21 | alias Identity!(mem[0]) _0; | |
22 | alias Identity!(mem[1]) _1; | |
23 | alias Identity!(mem[2]) _2; | |
24 | ||
25 | alias mem this; | |
26 | ||
27 | enum length = mem.length; | |
28 | } | |
29 | ||
30 | private template Identity(alias T) | |
31 | { | |
32 | alias T Identity; | |
33 | } | |
34 | ||
35 | ||
36 | void main() { | |
37 | alias Tuple!(int, long, float) TL; | |
38 | foreach (i; TL) | |
39 | { } | |
40 | } | |
41 |