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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 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: -------