+ ir_type *owner = get_entity_owner(static_ent);
+ if (owner == dynamic_class) return static_ent;
+
+ // if the owner of the static_ent already is more special than the dynamic
+ // type to check against - stop here.
+ if (! is_SubClass_of(dynamic_class, owner)) return NULL;