X-Git-Url: http://nitlanguage.org diff --git a/src/metrics/detect_covariance.nit b/src/metrics/detect_covariance.nit index 746ad9e..c80f929 100644 --- a/src/metrics/detect_covariance.nit +++ b/src/metrics/detect_covariance.nit @@ -204,7 +204,7 @@ private class DetectCovariancePhase ## ONLY covariance remains here - cpt_modules.inc(mmodule.mgroup.mproject.name) + cpt_modules.inc(mmodule.mgroup.mpackage.name) cpt_classes.inc(sub.mclass) # Track if `cpt_explanations` is already decided (used to fallback on unknown) @@ -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}