Re: Nice's DbC vs Eiffel DbC
"Daniel Bonniot" <[email protected]> Tue, 12 Feb 2008 17:12:20 +0100
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, > I can give full prototype for Derived#test (e.g. public void test(=85)). = In > such case compiler warns me: > > D:\home\eao197\tmp\nice\contracts\pre\main.nice: line 12, column 29: > warning: This method overrides nice.lang.void test(pre.Base > this,java.lang.String value)requires `>`(value.length(), 8):"value must be > at least 8 symbols", > You should make this explicit, either by omitting the return type > or by using the 'override' keyword As the message says, you could get rid of the warning by adding the override keyword. > I think, compiler should allow precondition specification in overridden > methods. It does, using this second form. Regarding execution of pre and post conditions in overriden methods, I don't have the details in memory at the moment, but you are welcome to test it. Cheers, Daniel ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/