[Issue 8952] New: nested structs with conext pointers fail

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 3 03:00:21 PDT 2012


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

           Summary: nested structs with conext pointers fail
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2012-11-03 03:00:20 PDT ---
Nesting a struct with a context pointer into another will fail.
//----
import std.stdio;

void main()
{
    int a;

    struct S
    {
        void doit()
        {
            writeln("pre ++a");
            ++a;
            writeln("post ++a");
        }
    }

    static struct SS
    {
        S s;
    }

    SS ss;
    ss.s.doit();
}
//----
pre ++a
object.Error: Access Violation
//----

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