Skip to content

Commit

Permalink
Add test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
H. S. Teoh committed Sep 26, 2014
1 parent fac98f1 commit c617337
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/runnable/xtest46.d
Expand Up @@ -7187,6 +7187,26 @@ void test13476()
assert(flag13476 == 2);
}

template Seq8262(T...) { alias T Seq8262; }

void test8262()
{
static struct S
{
int s;
alias Seq8262!s x;
alias x this;
}

//writeln(S.init); // from original test case

// The root of the original problem is that the nested alias this fails to
// make S implicitly convertible to S.s.
auto s = S(123);
static assert(is(typeof(s) : int));
assert(s == 123);
}

/***************************************************/

int main()
Expand Down Expand Up @@ -7486,6 +7506,7 @@ int main()
test13437();
test13472();
test13476();
test8262();

printf("Success\n");
return 0;
Expand Down

0 comments on commit c617337

Please sign in to comment.