rta: micro-factorization of call on `msignature`
authorJean Privat <jean@pryen.org>
Mon, 12 May 2014 19:45:17 +0000 (15:45 -0400)
committerJean Privat <jean@pryen.org>
Tue, 13 May 2014 10:06:22 +0000 (06:06 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/rapid_type_analysis.nit

index 3d7ec38..b2683c2 100644 (file)
@@ -219,12 +219,12 @@ class RapidTypeAnalysis
                                v.add_monomorphic_send(vararg, self.modelbuilder.force_get_primitive_method(node, "with_native", vararg.mclass, self.mainmodule))
                        end
 
-
-                       for i in [0..mmethoddef.msignature.arity[ do
-                               var origtype = mmeth.intro.msignature.mparameters[i].mtype
+                       var sig = mmethoddef.msignature.as(not null)
+                       var osig = mmeth.intro.msignature.as(not null)
+                       for i in [0..sig.arity[ do
+                               var origtype = osig.mparameters[i].mtype
                                if not origtype.need_anchor then continue # skip non covariant stuff
-                               var paramtype = mmethoddef.msignature.mparameters[i].mtype
-                               #paramtype = v.cleanup_type(paramtype).as(not null)
+                               var paramtype = sig.mparameters[i].mtype
                                add_cast(paramtype)
                        end