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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 4 15:16:54 PDT 2012


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



--- Comment #41 from Walter Bright <bugzilla at digitalmars.com> 2012-05-04 15:18:08 PDT ---
(In reply to comment #40)
> (In reply to comment #39)
> > Please write a piece of code that asserts when it should not, or passes when it
> > should not, compile it, verify this incorrect behavior, and post it here.
> 
> Timon has already done this and posted it in the description when filing this
> report in the first place.

Example #1 expects behavior based on the static type, which is not polymorphic
OOP at all. Of course x.foo() should check B's widened interface, because:

    x is a B!

The example's rationale is completely invalid.

Please read Meyer's book.

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