X-Git-Url: http://nitlanguage.org diff --git a/src/metrics/detect_covariance.nit b/src/metrics/detect_covariance.nit index 4a3437d..1ab719b 100644 --- a/src/metrics/detect_covariance.nit +++ b/src/metrics/detect_covariance.nit @@ -343,7 +343,7 @@ redef class TypeVisitor return sub end - redef fun check_subtype(node: ANode, sub, sup: MType): nullable MType + redef fun check_subtype(node: ANode, sub, sup: MType, autocast: Bool): nullable MType do var res = super @@ -361,6 +361,9 @@ redef class TypeVisitor if node isa AAsCastExpr then return res end + if not autocast then + return res + end sup = supx.resolve_for(anchor.mclass.mclass_type, anchor, mmodule, true) if self.is_subtype(sub, sup) then dcp.cpt_autocast.inc("vt")