Comment #0 by andrej.mitrovich — 2013-04-01T23:59:43Z
struct Tuple(Types...)
{
alias TypeTuple = Types;
alias TypeTuple this;
}
alias list = Tuple!int;
void main()
{
static assert(is(list.TypeTuple[0] == int)); // ok
pragma(msg, list[0]); // 'int'
static assert(is(list[0] == int)); // ng
}
Comment #1 by hsteoh — 2014-08-29T14:39:05Z
git HEAD may have regressed:
------
$ dmd test.d
test.d(12): Error: no [] operator overload for type Tuple!int
test.d(12): while evaluating pragma(msg, (Tuple!int)[0])
test.d(13): Error: static assert (is(Tuple!int[0] == int)) is false
$
------
Note the error on line 12, which is the pragma(msg) line.
Comment #2 by dlang-bugzilla — 2017-07-03T21:30:52Z