http://d.puremagic.com/issues/show_bug.cgi?id=8422

           Summary: TypeTuple of tuples can't be read at compile time
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisp...@gmx.com> 2012-07-24 00:59:39 
PDT ---
This program

import std.typecons;
import std.typetuple;

void main()
{
    enum a = tuple(0, 1);
    enum b = tuple(0, 2);
    foreach(t; TypeTuple!(a, b))
    {
        enum u = t;
    }
}

fails to compile, giving this error:

q.d(10): Error: variable t cannot be read at compile time
q.d(10): Error: variable t cannot be read at compile time

And this one

import std.typecons;
import std.typetuple;

void main()
{
    enum a = tuple(0, 1);
    enum b = tuple(0, 2);
    enum c = TypeTuple!(a, b);
    enum t = c[0];
}

fails with this error:

q.d(8): Error: variable _c_field_0 cannot be read at compile time

tuple works just fine at compile time. TypeTuple obviously works just fine at
compile time, since it's a compile time construct. But for some reason, a
TypeTuple of tuples doesn't work, which is really annoying when you need a
static foreach over a list of groups of values and you can't use a TypeTuple of
TypeTuples, since they'd flatten.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to