- if supers.is_empty and name != once ("Object".to_symbol) then
- var t_any = mmmodule.type_any
- supers.add(t_any.local_class)
- var default = new MMDefaultAncestor(self, t_any)
- add_direct_parent(default)
+ if name != once ("Object".to_symbol) then
+ var has_no_top = false
+ if supers.is_empty then
+ has_no_top = true
+ else if global.is_extern then
+ has_no_top = true
+ for s in supers do
+ if s.global.is_extern then
+ has_no_top = false
+ break
+ end
+ end
+ end
+
+ if has_no_top then
+ var top_type
+ if name != once ("Pointer".to_symbol) and global.is_extern then
+ top_type = mmmodule.type_any_extern
+ else
+ top_type = mmmodule.type_any
+ end
+ supers.add(top_type.local_class)
+ var default = new MMDefaultAncestor(self, top_type)
+ add_direct_parent(default)
+ end