On 19/06/14 15:59, Timon Gehr wrote:
On 06/18/2014 09:54 PM, Meta wrote:
...

This could be a bad thing. It makes it pretty enticing to use contracts
as input verification instead of logic verification.

The following is doable as well with a standard range analysis:

byte foo(immutable int x){
     if(x<byte.min || x>byte.max)
         throw new InvalidArgumentException("...");
     return x; // ok
}

That will only work now if you use an "else".

Reply via email to