Pre/post conditions not working?
Marek Janukowicz <[email protected]> Thu, 13 Jan 2011 00:49:15 +0100
| Newsgroups | gmane.comp.lang.sather.announce |
|---|---|
| Organization | Starware |
| Message-ID | <[email protected]> |
Hello again
Are pre/post conditions supported by default? I have a test program:
class MAIN is
attr a : INT;
create( a : INT ) : SAME
pre a < 10
post self.a < 5
is
res ::= new;
res.a := a;
return res;
end;
main
pre 1 > 2
post 1 > 2
is
#OUT + (1 > 2) + "\n";
obj ::= #MAIN( 12 );
#OUT + "should not create\n";
end;
end;
and it doesn't raise any error, displaying the messages (as it should if the
preconditions were not there). Do I need to somehow switch on with some
compiler switch?
--
Marek Janukowicz