Thread overview
[Issue 21298] Missing error when overriding interface method without in contract with class method with contract
3 days ago
Walter Bright
3 days ago
Dlang Bot
3 days ago
Walter Bright
October 09
https://issues.dlang.org/show_bug.cgi?id=21298

John Colvin <john.loughran.colvin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry
                 CC|                            |john.loughran.colvin@gmail.
                   |                            |com

--
October 09
https://issues.dlang.org/show_bug.cgi?id=21298

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--
October 09
https://issues.dlang.org/show_bug.cgi?id=21298

--- Comment #1 from Mario Kroeplin <kroeplin.d@googlemail.com> ---
Worse: no semantic analysis is done for the in condition of the override:

class C : I
{
  override void foo(int i) in (something, stupid) { }
}

--
3 days ago
https://issues.dlang.org/show_bug.cgi?id=21298

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
Changing I to a class still does not cause the error. A function body has to be provided to I.foo() to trigger the error.

--
3 days ago
https://issues.dlang.org/show_bug.cgi?id=21298

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #12013 "fix Issue 21298 - Missing error when overriding interface method with…" fixing this issue:

- fix Issue 21298 - Missing error when overriding interface method without in contract with class method with contract

https://github.com/dlang/dmd/pull/12013

--
3 days ago
https://issues.dlang.org/show_bug.cgi?id=21298

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
I'm not convinced this should be an error. An interface doesn't implement a function. The class providing the function isn't overriding the interface, it is implementing it.

--