www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12321] New: Contracts of implemented interface method aren't called

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

           Summary: Contracts of implemented interface method aren't
                    called
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: NCrashed gmail.com


--- Comment #0 from NCrashed gmail.com 2014-03-08 11:41:33 PST ---
DMD64 D Compiler v2.065

Contract isn't called:
```
interface IA 
{
    shared void foo();
}

synchronized class A : IA
{
    void foo()
    in 
    {
        assert(false);
    }
    body
    {

    }

}

void main()
{
    shared IA a1 = new shared A();

    a1.foo();
}
```

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 08 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12321



--- Comment #1 from NCrashed gmail.com 2014-03-08 11:43:27 PST ---
Can be duplicate of:
[7517](http://d.puremagic.com/issues/show_bug.cgi?id=7517),
[12247](http://d.puremagic.com/issues/show_bug.cgi?id=12247),
[6856](http://d.puremagic.com/issues/show_bug.cgi?id=6856)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 08 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12321



--- Comment #2 from NCrashed gmail.com 2014-03-08 11:48:25 PST ---
Workaround: add empty in{} after interface method specification.
```
void foo() in {}
```

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 08 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12321



--- Comment #3 from NCrashed gmail.com 2014-03-08 11:54:57 PST ---
(In reply to comment #2)
 Workaround: add empty in{} after interface method specification.
 ```
 void foo() in {}
 ```

Unfortunately i harried up. This enables only unreachable code detection, but contract still isn't called. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 08 2014