nitg: fix FFI error with arguments name of extern methods
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 5 Mar 2014 22:45:04 +0000 (17:45 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 6 Mar 2014 18:18:12 +0000 (13:18 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/compiler_ffi.nit
src/nitni/nitni_utilities.nit

index df9eddd..ace2b35 100644 (file)
@@ -352,7 +352,7 @@ redef class MExplicitCall
                # Internally, implement internal function
                var nitni_visitor = v.compiler.new_visitor
                nitni_visitor.frame = v.frame
-               var msignature = mproperty.intro.msignature
+               var msignature = mproperty.lookup_first_definition(v.compiler.mainmodule, recv_mtype).msignature
                var csignature_blind = mproperty.build_csignature(recv_mtype, v.compiler.mainmodule, null, long_signature, internal_call_context)
 
                nitni_visitor.add_decl("/* nitni callback for {mproperty.full_name} */")
@@ -420,7 +420,7 @@ redef class MExplicitSuper
                # Internally, implement internal function
                var nitni_visitor = v.compiler.new_visitor
                nitni_visitor.frame = v.frame
-               var msignature = mproperty.intro.msignature
+               var msignature = mproperty.lookup_first_definition(v.compiler.mainmodule, mclass_type).msignature
 
                var csignature_blind = mproperty.build_csignature(mclass_type, v.compiler.mainmodule, "___super", long_signature, internal_call_context)
 
index 80c6691..8cacbf1 100644 (file)
@@ -53,7 +53,8 @@ redef class MMethod
        # * The `call_context` identifying which types and casts to use (see `CallContext` and its instances)
        fun build_csignature(recv_mtype: MClassType, from_mmodule: MModule, suffix: nullable String, length: SignatureLength, call_context: CallContext): String
        do
-               var signature = self.intro.msignature
+               var mmethoddef = lookup_first_definition(from_mmodule, recv_mtype)
+               var signature = mmethoddef.msignature
                assert signature != null
 
                var creturn_type
@@ -93,7 +94,8 @@ redef class MMethod
        do
                if param_suffix == null then param_suffix = ""
 
-               var signature = self.intro.msignature
+               var mmethoddef = lookup_first_definition(from_mmodule, recv_mtype)
+               var signature = mmethoddef.msignature
                assert signature != null
 
                var return_mtype = null