Thread overview
[Issue 7983] New: ICE with getMember on a unittest member
Apr 25, 2012
Kenji Hara
Apr 29, 2012
Walter Bright
Apr 29, 2012
Walter Bright
April 24, 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@puremagic.com
        ReportedBy: hsteoh@quickfur.ath.cx


--- Comment #0 from hsteoh@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: -------
April 25, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7983


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-04-24 17:36:44 PDT ---
https://github.com/D-Programming-Language/dmd/pull/906

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 27, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7983



--- Comment #2 from github-bugzilla@puremagic.com 2012-04-26 20:03:44 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0e2c31f15fb6bb9809c0ff65b639aa1d76da4d91 fix Issue 7983 - ICE with getMember on a unittest member

Front-end should not switch its semantic process by global.params.useUnitTests.

https://github.com/D-Programming-Language/dmd/commit/e0fcf85e13d2cb0b82189927c3a5eb52a47343a2 Merge pull request #906 from 9rnsr/fix7983

Issue 7983 - ICE with getMember on a unittest member

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7983


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2012-04-28 22:17:20 PDT ---
Fix by making unittests not a member enumerated by allMembers. They really aren't designed to be manipulated by the user.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7983



--- Comment #4 from github-bugzilla@puremagic.com 2012-04-28 22:53:35 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e1a838b26001abb85cb8dce8c8ccc91486f49856 fix Issue 7983 - ICE with getMember on a unittest member

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7983


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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