| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/casttuple.d(104): Error: cannot cast `__tup1_field_0` of type `int` to type sequence `(string)` |
| 5 |
fail_compilation/casttuple.d(107): Error: cannot cast `AliasSeq!(__tup2_field_0, __tup2_field_1)` of type `(int, int)` to type sequence `(string, string)` |
| 6 |
fail_compilation/casttuple.d(111): Error: cannot cast `AliasSeq!(foo, 123)` of type `(int, int)` to type sequence `(string, string)` |
| 7 |
--- |
| 8 |
*/ |
| 9 |
|
| 10 |
alias tuple(T...) = T; |
| 11 |
|
| 12 |
#line 100 |
| 13 |
|
| 14 |
void nomatch() |
| 15 |
{ |
| 16 |
tuple!int tup1; |
| 17 |
auto x = cast(tuple!string) tup1; |
| 18 |
|
| 19 |
tuple!(int, int) tup2; |
| 20 |
auto y = cast(tuple!(string, string)) tup2; |
| 21 |
|
| 22 |
int foo; |
| 23 |
alias tup3 = tuple!(foo, 123); |
| 24 |
auto z = cast(tuple!(string, string)) tup3; |
| 25 |
} |