[Issue 10940] New: Interface post-condition breaks sub-interface covariance.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 1 10:40:00 PDT 2013


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

           Summary: Interface post-condition breaks sub-interface
                    covariance.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jeremiep at gmail.com


--- Comment #0 from Jeremie Pelletier <jeremiep at gmail.com> 2013-09-01 10:39:59 PDT ---
This code triggers the bug:

    interface A1 { A1 f() out(o) { assert(o !is null); } }
    interface A2 : A1 { override A2 f(); }

making the compiler output the following:

    Error: cast(const(A1))__result is not an lvalue

However, it compiles fine if I either remove the contract or change A2 to a
class.

I'm using DMD 2.063.2 on OS X Lion.

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