abort
end
+ # Is the virtual type fixed for a given resolved_receiver?
+ fun is_fixed(mmodule: MModule, resolved_receiver: MType): Bool
+ do
+ assert not resolved_receiver.need_anchor
+ var props = self.mproperty.lookup_definitions(mmodule, resolved_receiver)
+ if props.is_empty then
+ abort
+ end
+ for p in props do
+ if p.as(MVirtualTypeDef).is_fixed then return true
+ end
+ return false
+ end
+
redef fun resolve_for(mtype, anchor, mmodule, cleanup_virtual)
do
assert can_resolve_for(mtype, anchor, mmodule)
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
# It the resolved type isa intern class, then there is no possible valid redefinition is any potentiel 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.