[Issue 6856] Preconditions are not inherited

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 27 22:14:08 PST 2012


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



--- Comment #24 from Don <clugdbug at yahoo.com.au> 2012-02-27 22:14:03 PST ---
(In reply to comment #23)
> (In reply to comment #22)
> > What this means in practice is that in contracts must be BEFORE the vtable
> > lookup, rather than being in the body of the function.
> 
> Yes, that is issue 6857.

OK, then this issue is quite simple.
All that seems to be required is, to define "no in() contract" to mean "use
default precondition". So that if a derived class has no in(), instead of
getting

base.in() || true

(which means that the precondition gets stripped away) it gets

base.in() || false.

(which means it uses the precondition from the base class). As now, an explicit
in{} strips the precondition away.
And nothing else needs to change.

Works?

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