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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 5 04:39:43 PDT 2012


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



--- Comment #49 from Stewart Gordon <smjg at iname.com> 2012-05-05 04:40:48 PDT ---
(In reply to comment #47)
> (In reply to comment #46)
> > Now, change F from a struct to a class. We believe that the code should still
> > fail to compile.
> 
> A theorem prover could not produce a compile time error, because it could not
> prove that f is actually an F, and not of a class derived from F.

You have completely ignored the whole point of this request, which has been
explained to you by four of us several times over.

> OOP is runtime polymorphism, not compile time. A struct type is fundamentally
> different from a class type.

Runtime polymorphism is about overriding behaviour, not overriding legality.

> And lastly, your request is quite different from Example #1, which is asserting
> that the contract for A.foo() must always pass, even if it's calling B.foo().

What are you talking about?

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