From: Florian Deljarry Date: Tue, 13 Aug 2019 16:13:30 +0000 (-0400) Subject: astbuilder: Add a `create_callsite` method X-Git-Url: http://nitlanguage.org astbuilder: Add a `create_callsite` method Add a `create_callsite` method to facilitate the construction of callsite. Signed-off-by: Florian Deljarry --- diff --git a/src/astbuilder.nit b/src/astbuilder.nit index 36f157f..d81ac6b 100644 --- a/src/astbuilder.nit +++ b/src/astbuilder.nit @@ -157,6 +157,14 @@ class ASTBuilder do return new AReturnExpr.make(expr) end + # Create a callsite with the given `mproperty`. Take the current method `actual_method` as a context + fun create_callsite(modelbuilder: ModelBuilder, actual_method : AMethPropdef, mproperty: MMethod, is_self_call: Bool): CallSite + do + var type_visitor = new TypeVisitor(modelbuilder, actual_method.mpropdef.as(not null)) + var callsite = type_visitor.build_callsite_by_property(actual_method, mproperty.intro_mclassdef.bound_mtype, mproperty, is_self_call) + assert callsite != null + return callsite + end end redef class AExpr