var mask = sub.mclass.vtable.mask
var res = inter_is_subtype_ph(super_id, mask, sub.mclass.vtable.internal_vtable)
- if res == false then return false
+ if not res then return false
# sub and sup can be generic types, each argument of generics has to be tested
if not sup isa MGenericType then return true
var sub_arg = sub2.arguments[i]
var sup_arg = sup.arguments[i]
var res2 = is_subtype(sub_arg, sup_arg)
- if res2 == false then return false
+ if not res2 then return false
end
return true
end
do
if mclass.loaded then return
- # Recursively load superclasses
- for parent in mclass.in_hierarchy(mainmodule).direct_greaters do load_class_indirect(parent)
+ load_supers(mclass)
if mclass.abstract_loaded then
mclass.allocate_vtable(self)
end
end
+ # Recursively load superclasses.
+ private fun load_supers(mclass: MClass)
+ do
+ for parent in mclass.in_hierarchy(mainmodule).direct_greaters do
+ load_class_indirect(parent)
+ end
+ end
+
# This method is called to handle an implicitly loaded class,
# i.e. a superclass of an explicitly loaded class
# A class loaded implicitly will not be fully allocated
# It the class was already implicitly loaded
if mclass.abstract_loaded then return
- for parent in mclass.in_hierarchy(mainmodule).direct_greaters do load_class_indirect(parent)
+ load_supers(mclass)
mclass.make_vt(self, false)
end