I am playing around with contracts and can't get the following code to run:
interface Food
get healthValue as int
ensure result > 0
The error I get is
- Code: Select all
oops.cobra(4,9): error: Expecting DEDENT, but got "ensure" instead.
Compilation failed - 1 error, 0 warnings
It seems contracts are not supported in interfaces or abstract classes. Is that correct?
Regards,
blubb