info-sather
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pre/post conditions not working?


From: Marek Janukowicz
Subject: Pre/post conditions not working?
Date: Thu, 13 Jan 2011 00:49:15 +0100
User-agent: KMail/1.13.3 (Linux/2.6.32-gentoo-r7; KDE/4.5.2; x86_64; ; )

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]