From: Florian Deljarry Date: Mon, 30 Sep 2019 02:17:53 +0000 (-0400) Subject: src/contracts: Fix contracts on virtual and generic type X-Git-Url: http://nitlanguage.org src/contracts: Fix contracts on virtual and generic type Signed-off-by: Florian Deljarry --- diff --git a/src/contracts.nit b/src/contracts.nit index 156bb53..8244170 100644 --- a/src/contracts.nit +++ b/src/contracts.nit @@ -158,7 +158,7 @@ private class CallSiteVisitor var visited_mpropdef = visited_method.mpropdef assert contract_facet != null and visited_mpropdef != null - var unsafe_mtype = callsite.recv.resolve_for(callsite.recv, callsite.anchor, visited_mpropdef.mclassdef.mmodule, false) + var unsafe_mtype = callsite.recv.resolve_for(visited_mpropdef.mclassdef.bound_mtype, callsite.anchor, visited_mpropdef.mclassdef.mmodule, true) # This check is needed because the contract can appear after the introduction. if unsafe_mtype.has_mproperty(visited_method.mpropdef.mclassdef.mmodule, contract_facet) then