- for mtype in rta.live_types do
- # We are only interested in instanciated generics, subtypes of Serializable
- # and which are visibles.
- if mtype isa MGenericType and
- mtype.is_subtype(mmodule, null, serializable_type) and
- mtype.is_visible_from(mmodule) then
-
- nit_module.content.add """
+ var compiled_types = new Array[MType]
+ for m in target_modules do
+ nit_module.content.add """
+ # Module: {{{m.to_s}}}"""
+
+ var rta = modelbuilder.do_rapid_type_analysis(m)
+
+ for mtype in rta.live_types do
+ # We are only interested in instanciated generics, subtypes of Serializable
+ # and which are visible.
+ if mtype isa MGenericType and
+ mtype.is_subtype(m, null, serializable_type) and
+ mtype.is_visible_from(mmodule) and
+ mtype.mclass.kind == concrete_kind and
+ not compiled_types.has(mtype) then
+
+ compiled_types.add mtype
+ nit_module.content.add """