[Issue 6857] Precondition contract checks should be statically bound.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 2 15:08:53 PDT 2012


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


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |WONTFIX


--- Comment #8 from timon.gehr at gmx.ch 2012-05-02 15:10:01 PDT ---
(In reply to comment #7)
> This is a misunderstanding about how inheritance works.

No, it is not. The precondition is what needs to be satisfied by the client of
the method. The client has no way to know what exactly to satisfy if the
precondition is dynamically bound, therefore the client usually has to assume
that they have to satisfy the statically bound precondition. Failure to do so
is a bug most of the time.

I am not going to argue this further. It can probably go either way. The
current behavior detects less bugs, but the proposed change would make writing
contracts for certain cases cases where eg. a method accepts a parameter that
has distinct restrictions depending on the result of a previous method
invocation on the same object a little bit harder.

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