March 18, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9746

           Summary: Incorrect method parameters in out-block of `final`
                    class member functions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: verylonglogin.reg@gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-03-18 15:12:50 MSK ---
---
import std.stdio;

class Class
{
    final void f(int val)
    in
    {
        // Uncomment to detrigger the issue
        // writefln("in %s: %s", &val, val);
    }
    out
    {
        writefln("out %s: %s", &val, val);
        assert(val == 7);
    }
    body
    {
        writefln("body %s: %s", &val, val);
    }
}

void main(string[] args) {
    (new Class).f(7);
}
---

Output (one can see 0x10 address shift here):
---
body 12FDF8: 7
out 12FDE8: 1245036
core.exception.AssertError@main(14): Assertion failure
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home