[Issue 9828] Inconsistent lowering of 1-element tuple to its element

2016-08-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9828

Andrej Mitrovic  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Andrej Mitrovic  ---
Indeed I came to the same conclusions. The tuple is only lowered on request,
like for alias parameters. In the last code example `Foo[0]` should be used;

--


[Issue 9828] Inconsistent lowering of 1-element tuple to its element

2014-09-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9828

hst...@quickfur.ath.cx changed:

   What|Removed |Added

 CC||hst...@quickfur.ath.cx

--


[Issue 9828] Inconsistent lowering of 1-element tuple to its element

2013-03-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9828



--- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-03-29 
08:59:30 PDT ---
Here's an example of why it would be useful if it's consistently allowed:

import std.typetuple;

template getTypes(T...)
{
alias getTypes = T;
}

void test(T)(T t)
{
alias attributes = getTypes!(__traits(getAttributes, T));

// NG: Even if tuple length is 1
// static if (attributes == S1) { }

// NG: '(string)' and '(string)' (why are they not comparable?)
// static if (attributes == TypeTuple!(S1)) { }

// Note: .length check is necessary, otherwise out of bounds errors occur
static if (attributes.length  attributes[0] == S1)
{
pragma(msg, T);
}
}

void main()
{
@(S1) static struct S1 { }
static struct S2 { }
test(S1());
test(S2());
}

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