From: Jean Privat Date: Mon, 24 Feb 2014 15:44:20 +0000 (-0500) Subject: RTA: force primitive types to be alive X-Git-Tag: v0.6.4~17^2~1 X-Git-Url: http://nitlanguage.org RTA: force primitive types to be alive Signed-off-by: Jean Privat --- diff --git a/src/rapid_type_analysis.nit b/src/rapid_type_analysis.nit index 820819d..e2422aa 100644 --- a/src/rapid_type_analysis.nit +++ b/src/rapid_type_analysis.nit @@ -81,6 +81,12 @@ class RapidTypeAnalysis # The method definitions that remain to visit private var todo = new List[MMethodDef] + private fun force_alive(classname: String) + do + var classes = self.modelbuilder.model.get_mclasses_by_name(classname) + if classes != null then for c in classes do self.add_new(c.mclass_type, c.mclass_type) + end + # Run the analysis until all visitable method definitions are visited. fun run_analysis do @@ -96,9 +102,11 @@ class RapidTypeAnalysis add_send(maintype, mainprop) end - # Force Bool - var classes = self.modelbuilder.model.get_mclasses_by_name("Bool") - if classes != null then for c in classes do self.add_new(c.mclass_type, c.mclass_type) + # Force primitive types + force_alive("Bool") + force_alive("Int") + force_alive("Float") + force_alive("Char") while not todo.is_empty do var mmethoddef = todo.shift