www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9413] New: Incorrect modification inside contracts is not detected correctly

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9413

           Summary: Incorrect modification inside contracts is not
                    detected correctly
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



L7 and L17 should cause errors, but doesn't.

int foo(int x)
in
{
    int a;
    int bar(int y)
    {
        x = 10; // L7
        return 2;
    }
    x = 10;     // L10 err, OK
}
out(r)
{
    int a;
    int baz(int y)
    {
        x = 10; // L17
        return 2;
    }
    x = 10;     // L20
}
body
{
    return 1;
}

output:
test.d(10): Error: variable test.foo.x cannot modify parameter 'x' in contract
test.d(10): Error: variable test.foo.x cannot modify parameter 'x' in contract
test.d(20): Error: variable test.foo.x cannot modify parameter 'x' in contract
test.d(20): Error: variable test.foo.x cannot modify parameter 'x' in contract

And, there is also duplicated error message issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 27 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9413


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/1569

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 28 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9413




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/bb7c2f1e5cf6d8d9f254007bf125b20c7825581d
fix Issue 9413 - Incorrect modification inside contracts is not detected
correctly

https://github.com/D-Programming-Language/dmd/commit/80de2b74d847fe38102cd32c69ffbbfacaaaf3a8


Issue 9413 & 9414 - Detect incorrect modification inside contracts

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9413


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2013