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


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au


--- Comment #1 from Don <clugd...@yahoo.com.au> 2012-08-27 00:54:20 PDT ---
This is not a CTFE issue.
It's odd because although the name is 'TypeTuple', it is NOT a type tuple!
As well as types, TypeTuple also accepts literals, and that's what's
happening here. It's not a tuple of tuples, but rather a
foreach over a tuple of struct literals. The fact that the struct literals
were compile-time constants, is lost. Another side-effect is that you
can modify the struct literal is an lvalue. This seems wrong.

Reduced test case:

template TypeTuple(TList...)
{
    alias TList TypeTuple;
}

struct T { int x; }

void main()
{
    enum a = T(1);
    enum b = 6;
    foreach(t; TypeTuple!(b, a))
    {
        enum u = t;
    }
}

Pull request:
https://github.com/D-Programming-Language/dmd/pull/1095

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

Reply via email to