[Issue 11265] New: Segfault while calling instance method of class defined inside struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 14 17:22:52 PDT 2013


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

           Summary: Segfault while calling instance method of class
                    defined inside struct
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jcrapuchettes at gmail.com


--- Comment #0 from Jonathan Crapuchettes <jcrapuchettes at gmail.com> 2013-10-14 17:22:51 PDT ---
Running with D 2.063.2 the following code compiles and runs without any
problems. Using git checkout 4a2fabf, the code compiles, but segfaults when
trav.empty() is called. Possible changes to the code that will allow it to run
correctly are noted in the comments.

struct S
{
    //works if the class is moved out of the struct
    class InnerClass //works if final is added
    {
        S s;    //works if removed

        bool empty()
        {
            return true;
        }
    }
}

void main()
{
    S.InnerClass trav = new S.InnerClass();
    trav.empty();
}

-- 
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