[Issue 7983] New: ICE with getMember on a unittest member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 24 16:05:45 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7983

           Summary: ICE with getMember on a unittest member
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: hsteoh at quickfur.ath.cx


--- Comment #0 from hsteoh at quickfur.ath.cx 2012-04-24 16:06:46 PDT ---
Minimized code:

class A {
        void f() {
                g(this);
        }
        unittest {
        }
}     
void g(T)(T a)
{      
        foreach (name; __traits(allMembers, T)) {
                pragma(msg, name);
                static if (__traits(compiles, &__traits(getMember, a, name)))
                {
                }
        }
}

Compiler output:
$ dmd -c bug.d
f
__unittest1
dmd: expression.c:6890: virtual Expression* DotVarExp::semantic(Scope*):
Assertion `type' failed.
Aborted
$

Output from the pragma(msg,...) shows that the problem is triggered when
getMember is called with the name of a unittest. However, moving the body of
g() inside f() makes the problem go away, so there seems to be more to the
problem than just the fact that getMember was called with a unittest argument.

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


More information about the Digitalmars-d-bugs mailing list