Check that sub is a subtype of sup.

Do not display an error message.

This method is used a an entry point for the modelize phase to test static subtypes. Some refinements could redefine it to collect statictics.

Property definitions

nitc $ ModelBuilder :: check_subtype
	# Check that `sub` is a subtype of `sup`.
	# Do not display an error message.
	#
	# This method is used a an entry point for the modelize phase to test static subtypes.
	# Some refinements could redefine it to collect statictics.
	fun check_subtype(node: ANode, mmodule: MModule, anchor: nullable MClassType, sub, sup: MType): Bool
	do
		return sub.is_subtype(mmodule, anchor, sup)
	end
src/modelbuilder_base.nit:510,2--518,4

nitc :: detect_covariance $ ModelBuilder :: check_subtype
	redef fun check_subtype(node, mmodule, anchor, sub, sup)
	do
		var res = super
		var dcp = toolcontext.detect_covariance_phase

		if dcp.is_disabled then return res

		if res then
			dcp.count_types(node, node, sub, sup, mmodule, anchor)
		else
			dcp.cpt_total_variance.inc("bad mb subtype")
		end

		return res
	end
src/metrics/detect_covariance.nit:300,2--314,4