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

           Summary: "In" contracts in interfaces missbehaving
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2010-08-15 
12:59:13 PDT ---
Code:

interface I
{
    int foo(int i)
      in { writeln(i); assert(i == 4); }
}

class Base : I
{
    int foo(int i)
    {
        return i;
    }
}

import std.stdio;

void main()
{
    auto b = new Base;
    b.foo(4);
}

The writeln will output garbage, ex: 
1630368629
core.exception.asserter...@test(83): Assertion failure

You can remove the writeln, but the assert still fails. I'm using the same
syntax as defined in the docs:
http://www.digitalmars.com/d/2.0/interface.html

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

Reply via email to