src/niti: do not support extern methods with non primitive parameters
authorAlexis Laferrière <alexis.laf@xymus.net>
Mon, 8 Jun 2015 12:20:46 +0000 (08:20 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 10 Jun 2015 10:49:25 +0000 (06:49 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit

index 415da3f..f9c8fb5 100644 (file)
@@ -30,8 +30,17 @@ redef class AMethPropdef
        fun supported_by_dynamic_ffi: Bool
        do
                var n_extern_code_block = n_extern_code_block
-               return n_extern_calls == null and n_extern_code_block != null and
-                          n_extern_code_block.is_c
+               if not (n_extern_calls == null and n_extern_code_block != null and
+                       n_extern_code_block.is_c) then return false
+
+               for mparam in mpropdef.msignature.mparameters do
+                       var mtype = mparam.mtype
+                       if not mtype.is_cprimitive then
+                               return false
+                       end
+               end
+
+               return true
        end
 end