+ fun add_call(mpropdef: MMethodDef)
+ do
+ if live_methoddefs.has(mpropdef) then return
+ live_methoddefs.add(mpropdef)
+ todo.add(mpropdef)
+
+ var mproperty = mpropdef.mproperty
+ if mproperty.mpropdefs.length <= 1 then return
+ # If all definitions of a method are live, we can remove the definition of the totry set
+ for d in mproperty.mpropdefs do
+ if d.is_abstract then continue
+ if not live_methoddefs.has(d) then return
+ end
+ #print "full property: {mpropdef.mproperty} for {mpropdef.mproperty.mpropdefs.length} definitions"
+ totry_methods_to_remove.add(mpropdef.mproperty)
+ end
+
+ fun add_send(recv: MType, mproperty: MMethod)
+ do
+ if try_methods.has(mproperty) then return
+ #print "new prop: {mproperty}"
+ live_methods.add(mproperty)
+ try_methods.add(mproperty)
+ if mproperty.mpropdefs.length == 1 then
+ # If there is only one definition, just add the definition and do not try again the property
+ var d = mproperty.mpropdefs.first
+ add_call(d)
+ return
+ end
+ # Else, the property is potentially called with various reciever
+ # So just try the methods with existing receiver and register it for future receiver
+ totry_methods.add(mproperty)
+ for c in live_classes do
+ try_send(c.intro.bound_mtype, mproperty)
+ end
+ end