www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8134] New: Arguments getting nonsensical values in out contract when method is final

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

           Summary: Arguments getting nonsensical values in out contract
                    when method is final
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: alex lycus.org



CEST ---
The following code is broken:

void main()
{
    auto foo = new class
    {
        final Object doNothing(Object obj)
        out (result) { assert (result is obj); }
        body {
            return obj;
        }
    };
    foo.doNothing(null);
}

The 'obj' parameter is set to some nonsensical value when doNothing() is marked
final. Remove the final and it works as expected.

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