+ var res = verbatim_bound.resolve_for(mtype, anchor, mmodule, cleanup_virtual)
+ #print "{class_name}: {self}/{mtype}/{anchor} -> {self}/{resolved_receiver}/{anchor} -> {verbatim_bound}/{mtype}/{anchor} -> {res}"
+
+ # What to return here? There is a bunch a special cases:
+ # If 'cleanup_virtual' we must return the resolved type, since we cannot return self
+ if cleanup_virtual then return res
+ # If the receiver is a intern class, then the virtual type cannot be redefined since there is no possible subclass. self is just fixed. so simply return the resolution
+ if resolved_reciever isa MNullableType then resolved_reciever = resolved_reciever.mtype
+ if resolved_reciever.as(MClassType).mclass.kind == enum_kind then return res
+ # If the resolved type isa MVirtualType, it means that self was bound to it, and cannot be unbound. self is just fixed. so return the resolution.
+ if res isa MVirtualType then return res
+ # If we are final, just return the resolution
+ if is_fixed(mmodule, resolved_reciever) then return res
+ # If the resolved type isa intern class, then there is no possible valid redefinition in any potential subclass. self is just fixed. so simply return the resolution
+ if res isa MClassType and res.mclass.kind == enum_kind then return res
+ # TODO: Add 'fixed' virtual type in the specification.
+ # TODO: What if bound to a MParameterType?
+ # Note that Nullable types can always be redefined by the non nullable version, so there is no specific case on it.
+
+ # If anything apply, then `self' cannot be resolved, so return self
+ return self
+ end
+
+ redef fun can_resolve_for(mtype, anchor, mmodule)
+ do
+ if mtype.need_anchor then
+ assert anchor != null
+ mtype = mtype.anchor_to(mmodule, anchor)
+ end
+ return mtype.has_mproperty(mmodule, mproperty)