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

--- Comment #0 from Andrej Mitrovic <> 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;

void test(T)(T t)
    foreach (member; __traits(allMembers, T))
        enum testString = "static if( is(typeof( to!string(__traits(getMember,
t, " ~ `"` ~ member ~ `"` ~ "))) )) { };";

void main()
    Foo 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:
------- You are receiving this mail because: -------

Reply via email to