src/astbuilder: generalize `create_callsite`
authorFlorian Deljarry <deljarry.florian@gmail.com>
Tue, 2 Jun 2020 14:59:54 +0000 (10:59 -0400)
committerFlorian Deljarry <deljarry.florian@gmail.com>
Tue, 2 Jun 2020 15:17:11 +0000 (11:17 -0400)
Generalize `create_callsite` to take into consideration AAttrPropdef

Signed-off-by: Florian Deljarry <deljarry.florian@gmail.com>

src/astbuilder.nit

index 3fe85fd..46b8265 100644 (file)
@@ -203,11 +203,11 @@ class ASTBuilder
 
        # Build a callsite to call the `mproperty` in the current method `caller_method`.
        # `is_self_call` indicate if the method caller is a property of `self`
-       fun create_callsite(modelbuilder: ModelBuilder, caller_method : AMethPropdef, mproperty: MMethod, is_self_call: Bool): CallSite
+       fun create_callsite(modelbuilder: ModelBuilder, caller_property: APropdef, mproperty: MMethod, is_self_call: Bool): CallSite
        do
                # FIXME It's not the better solution to call `TypeVisitor` here to build a model entity, but some make need to have a callsite
-               var type_visitor = new TypeVisitor(modelbuilder, caller_method.mpropdef.as(not null))
-               var callsite = type_visitor.build_callsite_by_property(caller_method, mproperty.intro_mclassdef.bound_mtype, mproperty, is_self_call)
+               var type_visitor = new TypeVisitor(modelbuilder, caller_property.mpropdef.as(not null))
+               var callsite = type_visitor.build_callsite_by_property(caller_property, mproperty.intro_mclassdef.bound_mtype, mproperty, is_self_call)
                assert callsite != null
                return callsite
        end