The returned ASignature
is the copy of self
without return type.
The return type is replaced by a new parameter result
# Create a new ASignature adapted for ensure
#
# The returned `ASignature` is the copy of `self` without return type.
# The return type is replaced by a new parameter `result`
private fun adapt_to_ensurecondition: ASignature do
var nsignature = adapt_to_contract
if ret_type != null then
var variable = new Variable("result")
variable.declared_type = ret_type
nsignature.n_params.add new AParam.make(variable, ret_type.create_ast_representation)
end
return nsignature
end
src/contracts.nit:818,2--830,4