nitc :: MContract :: create_subcontract
Example:
fun contrat([...])
do
super # Call the old contracts
assert new_condition
end
# Create a contract to check the old (super call) and the new conditions
#
# Example:
# ~~~nitish
# fun contrat([...])
# do
# super # Call the old contracts
# assert new_condition
# end
# ~~~
#
private fun create_subcontract(v: ContractsVisitor, n_conditions: Array[AExpr], mclassdef: MClassDef)
do
var args = v.n_signature.make_parameter_read(v.ast_builder)
var n_block = v.ast_builder.make_block
n_block = self.create_inherit_nblock(v, n_conditions, args)
make_contract(v, n_block, mclassdef)
end
src/contracts.nit:340,2--357,4