X-Git-Url: http://nitlanguage.org diff --git a/src/metrics/detect_covariance.nit b/src/metrics/detect_covariance.nit index 25463ad..c80f929 100644 --- a/src/metrics/detect_covariance.nit +++ b/src/metrics/detect_covariance.nit @@ -350,7 +350,6 @@ redef class TypeVisitor if dcp.is_disabled then return res var anchor = self.anchor - assert anchor != null var supx = sup var subx = sub var p = node.parent.as(not null) @@ -474,19 +473,19 @@ redef class MType end #print "4.is {sub} a {sup}? <- no more resolution" - assert sub isa MClassType # It is the only remaining type - - # A unfixed formal type can only accept itself - if sup isa MFormalType then - return false + if sub isa MBottomType or sub isa MErrorType then + return true end - if sup isa MNullType then - # `sup` accepts only null + assert sub isa MClassType else print_error "{sub}