model: rta uses its visitor only to visit FFI extern methods
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 19 Jul 2013 18:20:36 +0000 (14:20 -0400)
committerJean Privat <jean@pryen.org>
Mon, 17 Feb 2014 14:14:48 +0000 (09:14 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/rapid_type_analysis.nit

index e56951b..820819d 100644 (file)
@@ -153,12 +153,16 @@ class RapidTypeAnalysis
                                                v.add_monomorphic_send(v.receiver, auto_super_init)
                                        end
                                end
-                       else if npropdef isa AInternMethPropdef or npropdef isa AExternMethPropdef then
+                       else if npropdef isa AInternMethPropdef or
+                         (npropdef isa AExternMethPropdef and npropdef.n_extern != null) then
                                # UGLY: We force the "instantation" of the concrete return type if any
                                var ret = mmethoddef.msignature.return_mtype
                                if ret != null and ret isa MClassType and ret.mclass.kind != abstract_kind and ret.mclass.kind != interface_kind then
                                        v.add_type(ret)
                                end
+                       else if npropdef isa AExternMethPropdef then
+                               var nclassdef = npropdef.parent.as(AClassdef)
+                               v.enter_visit(npropdef)
                        else if npropdef isa AExternInitPropdef then
                                v.add_type(v.receiver)
                        else