[Issue 6856] Preconditions are not inherited

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 29 18:21:33 PDT 2011


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


Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg at iname.com


--- Comment #1 from Stewart Gordon <smjg at iname.com> 2011-10-29 18:20:20 PDT ---
http://www.digitalmars.com/d/1.0/dbc.html
"If a function in a derived class overrides a function in its super class, then
only one of the in contracts of the function and its base functions must be
satisfied. Overriding functions then becomes a process of loosening the in
contracts.

A function without an in contract means that any values of the function
parameters are allowed."

On an override, the semantics of an in contract are to _add_ to what is a legal
call of the method.  And the absence of an in contract in a function definition
is really syntactic sugar for an empty in contract.

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