+ var next = bound.lookup_bound(mmodule, anchor)
+ if not next isa MVirtualType then break
+ bound = next
+ end
+ end
+
+ # Check redefinitions
+ bound = mpropdef.bound.as(not null)
+ for p in mpropdef.mproperty.lookup_super_definitions(mmodule, anchor) do
+ var supbound = p.bound.as(not null)
+ if p.is_fixed then
+ modelbuilder.error(self, "Redef Error: Virtual type {mpropdef.mproperty} is fixed in super-class {p.mclassdef.mclass}")
+ break
+ end
+ if p.mclassdef.mclass == mclassdef.mclass then
+ # Still a warning to pass existing bad code
+ modelbuilder.warning(n_type, "Redef Error: a virtual type cannot be refined.")
+ break
+ end
+ if not bound.is_subtype(mmodule, anchor, supbound) then
+ modelbuilder.error(n_type, "Redef Error: Wrong bound type. Found {bound}, expected a subtype of {supbound}, as in {p}.")
+ break