https://issues.dlang.org/show_bug.cgi?id=15984

          Issue ID: 15984
           Summary: Interface contracts retrieve garbage instead of
                    parameters
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: contracts, wrong-code
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]
            Blocks: 7517

This code should run fine:
---
interface I
{
    void f(int i)
    in { assert(i == 5); } // Fails
}

class C : I
{
    void f(int i)
    in { } // To call contract
    body { }
}

void main()
{
    I i = new C;
    i.f(5);
}
---

Note: `(new C).f(5)` fails too but let's support correct contract
implementation (i.e. contract is called based on static type) in testcase.

--

Reply via email to