[Issue 11055] New: Regression (2.064 git-head): 'pure' function prevents its in-contract from checking parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 17 00:45:00 PDT 2013


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

           Summary: Regression (2.064 git-head): 'pure' function prevents
                    its in-contract from checking parameters
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kekeniro2 at yahoo.co.jp


--- Comment #0 from kekeniro2 at yahoo.co.jp 2013-09-17 00:45:00 PDT ---
This code doesn't work in git-head.
It is a regression introduced in 2.064 alpha.

CODE:
class SomeClass {
    pure void foo(int n) 
    in { assert( !n ); }
    body { }
}

OUTPUT:
Error: pure nested function '__require' cannot access mutable data 'n'

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