[Issue 8422] [CTFE] TypeTuple of tuples can't be read at compile time

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8422


Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #4 from Walter Bright  2012-09-13 
22:27:38 PDT ---
Fixed for D2.

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


[Issue 8422] [CTFE] TypeTuple of tuples can't be read at compile time

2012-09-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8422



--- Comment #3 from github-bugzi...@puremagic.com 2012-09-13 22:13:42 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0e8ae4524b12421312e80507e434405c2422fa45
Fix issue 8422 TypeTuple of tuples can't be read at compile time

A tuple foreach over a struct literal, or an array literal, should be
considered
to be a const assignment, just as foreach over a numeric or string literal is.
The struct literal should not be considered to be an lvalue.

https://github.com/D-Programming-Language/dmd/commit/800e85d48b1811005dde9b992ffd19f02c048973
Extra test case (array literals) for bug 8422

https://github.com/D-Programming-Language/dmd/commit/165667223d4c4a99b530fe603df8d81e2fc7dd59
Merge pull request #1095 from donc/ctfe8422tuple_of_literals

Fix issue 8422 TypeTuple of tuples can't be read at compile time

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


[Issue 8422] [CTFE] TypeTuple of tuples can't be read at compile time

2012-08-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8422



--- Comment #2 from Jonathan M Davis  2012-08-27 01:08:40 
PDT ---
I know fullwell that TypeTuple can hold more than just types. I need to be able
to iterate over a list of tuples at compile time, and a TypeTuple with foreach
should be the way to do that. I don't see why it wouldn't work beyond a
compiler bug.

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


[Issue 8422] [CTFE] TypeTuple of tuples can't be read at compile time

2012-08-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8422


Don  changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au


--- Comment #1 from Don  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: ---