From: Delja Date: Fri, 14 Aug 2020 15:17:33 +0000 (-0400) Subject: src/contracts: Fix `null` omit argument error X-Git-Url: http://nitlanguage.org src/contracts: Fix `null` omit argument error Resolve contract error when the null parameter is omitted. Signed-off-by: Delja --- diff --git a/src/contracts.nit b/src/contracts.nit index f7b81fa..f732065 100644 --- a/src/contracts.nit +++ b/src/contracts.nit @@ -587,7 +587,9 @@ redef class MMethod if not exist_contract_facet then # If has no contract facet in intro just create it if classdef != intro_mclassdef then - create_facet(v, intro_mclassdef, contract_facet, self) + var n_intro_face = create_facet(v, intro_mclassdef, contract_facet, self) + n_intro_face.location = self.intro.location + n_intro_face.do_all(v.toolcontext) end n_contract_facet = create_facet(v, classdef, contract_facet, self) else @@ -834,6 +836,8 @@ redef class ASendExpr var actual_callsite = callsite if actual_callsite != null then callsite = v.drive_callsite_to_contract(actual_callsite) + # Set the signature mapping with the old value, this avoids having to re-check the callsite. + callsite.signaturemap = actual_callsite.signaturemap end end end @@ -844,6 +848,8 @@ redef class ANewExpr var actual_callsite = callsite if actual_callsite != null then callsite = v.drive_callsite_to_contract(actual_callsite) + # Set the signature mapping with the old value, this avoids having to re-check the callsite + callsite.signaturemap = actual_callsite.signaturemap end end end