[Issue 8422] [CTFE] TypeTuple of tuples can't be read at compile time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 27 00:54:24 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8422
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |clugdbug at yahoo.com.au
--- Comment #1 from Don <clugdbug at 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: -------
More information about the Digitalmars-d-bugs
mailing list