[Issue 2120] New: scope class assignment doesn't copy the whole class content

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 21 08:47:39 PDT 2008


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

           Summary: scope class assignment doesn't copy the whole class
                    content
           Product: D
           Version: 1.030
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: davidl at 126.com


Not sure if following is a bug. I need the semantic of backing up a class in
the stack. 
class Scope
{
    int i;
    int j;
}

void func(Scope m)
{
    scope Scope save=m;
    m.i=4;
    assert(save.i==3);
}

void main()
{
    Scope t=new Scope;
    t.i=3;
    t.j=3;
    func(t);
}


-- 



More information about the Digitalmars-d-bugs mailing list