The length of the type seen as a tree.

  • A -> 1
  • G[A] -> 2
  • H[A, B] -> 3
  • H[G[A], B] -> 4

Formal types have a length of 1. Only MClassType and MFormalType nodes are counted.

Property definitions

nitc $ MType :: length
	# The length of the type seen as a tree.
	#
	# * A -> 1
	# * G[A] -> 2
	# * H[A, B] -> 3
	# * H[G[A], B] -> 4
	#
	# Formal types have a length of 1.
	# Only `MClassType` and `MFormalType` nodes are counted.
	fun length: Int
	do
		return 1
	end
src/model/model.nit:1238,2--1250,4

nitc $ MProxyType :: length
	redef fun length do return self.mtype.length
src/model/model.nit:1809,2--45

nitc $ MSignature :: length
	redef fun length
	do
		var res = 1
		var t = self.return_mtype
		if t != null then res += t.length
		for p in mparameters do
			res += p.mtype.length
		end
		return res
	end
src/model/model.nit:1995,2--2004,4

nitc $ MGenericType :: length
	redef fun length
	do
		var res = 1
		for a in self.arguments do
			res += a.length
		end
		return res
	end
src/model/model.nit:1495,2--1502,4