rta: check the type NativeArray before the method with_native in varargs
authorJean Privat <jean@pryen.org>
Wed, 12 Feb 2014 14:32:52 +0000 (09:32 -0500)
committerJean Privat <jean@pryen.org>
Wed, 12 Feb 2014 14:55:36 +0000 (09:55 -0500)
This is coherent with the other NativeArray stuff in RTA and the way
engines do it

Signed-off-by: Jean Privat <jean@pryen.org>

src/rapid_type_analysis.nit

index be9ea34..e56951b 100644 (file)
@@ -112,9 +112,9 @@ class RapidTypeAnalysis
                                #elttype = elttype.anchor_to(self.mainmodule, v.receiver)
                                var vararg = self.mainmodule.get_primitive_class("Array").get_mtype([elttype])
                                v.add_type(vararg)
-                               v.add_monomorphic_send(vararg, self.modelbuilder.force_get_primitive_method(node, "with_native", vararg.mclass, self.mainmodule))
                                var native = self.mainmodule.get_primitive_class("NativeArray").get_mtype([elttype])
                                v.add_type(native)
+                               v.add_monomorphic_send(vararg, self.modelbuilder.force_get_primitive_method(node, "with_native", vararg.mclass, self.mainmodule))
                        end