[Issue 6856] Preconditions are not inherited

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 1 06:00:26 PDT 2011


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



--- Comment #6 from timon.gehr at gmx.ch 2011-11-01 05:59:14 PDT ---
(In reply to comment #4)
> BTW, "in" contracts seems to be very ill defined, because overriding a method
> with an "in" contract without specifying an "in" contract should inherit the
> contract from the base class/interface, not remove the contract completely. You
> have to repeat the contract from the base class manually, that sucks. There
> should be some syntax to remove the contract instead, maybe something like:
> 
> void f()
> in delete
> body
> {
>   // ...
> }

I think it should just look like this:

override void f()
in{}body{
  // ...
}

If no explicit contract is added, it should be inherited.

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