[Issue 9746] New: Incorrect method parameters in out-block of `final` class member functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 18 05:12:51 PDT 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 at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at 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 at main(14): Assertion failure
---

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