http://d.puremagic.com/issues/show_bug.cgi?id=7613
Summary: __traits(getMember) on inner unittest: Assertion failure: 'type' on line 6695 in file 'expression.c' Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: andrej.mitrov...@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2012-02-29 11:20:53 PST --- I was attempting to use is(typeof) or __traits(compiles) to tell if a field of a struct can be converted to a string. However when __traits(getMember) tries to return a unittest this causes an ICE: import std.conv; struct Foo { int x; unittest { } } void test(T)(T t) { foreach (member; __traits(allMembers, T)) { enum testString = "static if( is(typeof( to!string(__traits(getMember, t, " ~ `"` ~ member ~ `"` ~ "))) )) { };"; mixin(testString); } } void main() { Foo foo; test(foo); __traits(getMember, foo, "__unittest1"); } Assertion failure: 'type' on line 6695 in file 'expression.c' The minimal test-case is the last line: __traits(getMember, foo, "__unittest1"); If it was simply an error it could be caught with is(typeof), but it's an ICE. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------