[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1386

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|2.003   |D2

--


[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2011-09-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1386


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #10 from Kenji Hara k.hara...@gmail.com 2011-09-22 10:20:26 PDT 
---
In 2.055, The problem in comment #9 does not occur by fixing bug 2234.
Therefore original sample code in comment #0 might work as expected.

But class has a member interface Monitor, so 

 typeid(typeof(__traits(getMember, a, member

will fail to compile.

If you change `class Asdf` into `struct Asdf`, you'll get following output:

asdf test.Temp!(uint).Temp
qwer test.Temp!(string).Temp
yxcv test.Temp!(real,real).Temp

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


[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2011-04-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1386


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

   What|Removed |Added

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


--- Comment #9 from Don clugd...@yahoo.com.au 2011-04-15 21:33:24 PDT ---
The error message is:
test2.d(22): Error: no property '__T4TempTkZ' for type 'test2.Asdf'
Some kind of junk tuple members are being included in allMembers.

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


[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2010-02-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1386



--- Comment #8 from Hoenir mrmoc...@gmx.de 2010-02-02 17:02:30 PST ---
allMembers returns a tuple now (svn r360) but this still doesn't work. Yields a
strange error.

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


[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2010-01-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1386


Simen Kjaeraas simen.kja...@gmail.com changed:

   What|Removed |Added

 CC||simen.kja...@gmail.com


--- Comment #7 from Simen Kjaeraas simen.kja...@gmail.com 2010-01-02 05:45:23 
PST ---
As a way to index allMembers as a tuple, here's a template converting an array
known at compile time to a tuple:

template ArrayToTuple( alias Arr, U... ) {
static if ( Arr.length ) {
alias ArrayToTuple!( Arr[ 0..$-1 ], Arr[ $-1 ], U ) ArrayToTuple;
} else {
alias U ArrayToTuple;
}
}

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


[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2009-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1386


mrmoc...@gmx.de changed:

   What|Removed |Added

 CC||mrmoc...@gmx.de
   Severity|normal  |blocker
Version|2.003   |2.027




-- 



[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2009-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1386


dhase...@gmail.com changed:

   What|Removed |Added

Version|2.027   |2.003




--- Comment #4 from dhase...@gmail.com  2009-04-01 17:44 ---
Leave the version number on the _earliest_ dmd version exhibiting the problem.


-- 



[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2009-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1386


dhase...@gmail.com changed:

   What|Removed |Added

   Severity|blocker |normal




--- Comment #5 from dhase...@gmail.com  2009-04-01 17:47 ---
Also, you can work around this using a for-loop (I think) or recursive
templates; and blocker refers to a bug sufficiently severe that Walter should
drop everything else and fix this bug, or even possibly roll back to an earlier
version that does not exhibit the bug.


-- 



[Issue 1386] string expected when using allMembers-element in __traits(getMember, ...)

2009-04-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1386





--- Comment #6 from mrmoc...@gmx.de  2009-04-01 17:54 ---
Ok, sorry didn't know.

Finally managed to compile a workaround:
template Sequence(size_t count, size_t index = 0)
{
static if (index  count)
alias Tuple!(index, Sequence!(count, index + 1)) Sequence;  
else
alias Tuple!() Sequence;
}

static const members = __traits (allMembers, foo);
foreach (i; Sequence!(members.length))
{
foreach (p; ParameterTypeTuple!(__traits(getMember, foo,
members[i])))
writefln(typeid(p));
}


--