From: Jean Privat Date: Wed, 28 Oct 2015 16:01:35 +0000 (-0400) Subject: modelize_property: use bottom type to mark invalid VT bounds X-Git-Tag: v0.7.9~2^2~4 X-Git-Url: http://nitlanguage.org modelize_property: use bottom type to mark invalid VT bounds Signed-off-by: Jean Privat --- diff --git a/src/modelize/modelize_property.nit b/src/modelize/modelize_property.nit index 0161ad0..b0c0f60 100644 --- a/src/modelize/modelize_property.nit +++ b/src/modelize/modelize_property.nit @@ -111,7 +111,7 @@ redef class ModelBuilder if not check_virtual_types_circularity(npropdef, mpropdef.mproperty, mclassdef.bound_mtype, mclassdef.mmodule) then # Invalidate the bound mpropdef.is_broken = true - mpropdef.bound = mclassdef.mmodule.model.null_type + mpropdef.bound = new MBottomType(mclassdef.mmodule.model) end end for npropdef in nclassdef2.n_propdefs do @@ -386,6 +386,8 @@ redef class ModelBuilder # nothing, always visible else if mtype isa MNullType then # nothing to do. + else if mtype isa MBottomType then + # nothing to do. else node.debug "Unexpected type {mtype}" abort @@ -1643,7 +1645,7 @@ redef class ATypePropdef # Check redefinitions for p in mpropdef.mproperty.lookup_super_definitions(mmodule, anchor) do var supbound = p.bound - if supbound == null then break # broken super bound, skip error + if supbound == null or supbound isa MBottomType or p.is_broken then break # broken super bound, skip error if p.is_fixed then modelbuilder.error(self, "Redef Error: virtual type `{mpropdef.mproperty}` is fixed in super-class `{p.mclassdef.mclass}`.") break