Support for ensure statements in function definitions