+ private fun check_depth(mtype: MClassType)
+ do
+ var d = mtype.length
+ if d > 255 then
+ self.modelbuilder.toolcontext.fatal_error(null, "Fatal error: limitation in the rapidtype analysis engine: a type depth of {d} is too important, the problematic type is {mtype}.")
+ end
+ end
+
+ fun add_new(recv: MClassType, mtype: MClassType)
+ do
+ assert not recv.need_anchor
+ if mtype.need_anchor then
+ if live_open_types.has(mtype) then return
+ live_open_types.add(mtype)
+ else
+ if live_types.has(mtype) then return
+ live_types.add(mtype)
+ end
+
+ var mclass = mtype.mclass
+ if live_classes.has(mclass) then return
+ live_classes.add(mclass)
+
+ for p in totry_methods do try_send(mtype, p)
+ for p in live_super_sends do try_super_send(mtype, p)
+
+ # Remove cleared ones
+ for p in totry_methods_to_remove do totry_methods.remove(p)
+ totry_methods_to_remove.clear
+
+ var bound_mtype = mtype.anchor_to(mainmodule, recv)
+ for cd in bound_mtype.collect_mclassdefs(mainmodule)
+ do
+ if not self.modelbuilder.mclassdef2nclassdef.has_key(cd) then continue
+ var nclassdef = self.modelbuilder.mclassdef2nclassdef[cd]
+ for npropdef in nclassdef.n_propdefs do
+ if not npropdef isa AAttrPropdef then continue
+ var nexpr = npropdef.n_expr
+ if nexpr == null then continue
+ var mpropdef = npropdef.mpropdef.as(not null)
+ var v = new RapidTypeVisitor(self, bound_mtype, mpropdef)
+ v.enter_visit(nexpr)
+ end
+ end
+
+ end