From c418e0e6026dd86214a597b260477a4f984882a4 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Sat, 4 Apr 2015 16:56:12 +0700 Subject: [PATCH] model: introduce MFormalType as a superclass of MVirtualType and MParameterType Strangely enough, they do not have common methods yet. It is why a super-class was never introduced. Signed-off-by: Jean Privat --- src/model/model.nit | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/model/model.nit b/src/model/model.nit index 76a3839..a5aeb76 100644 --- a/src/model/model.nit +++ b/src/model/model.nit @@ -1259,9 +1259,17 @@ class MGenericType end end +# A formal type (either virtual of parametric). +# +# The main issue with formal types is that they offer very little information on their own +# and need a context (anchor and mmodule) to be useful. +abstract class MFormalType + super MType +end + # A virtual formal type. class MVirtualType - super MType + super MFormalType # The property associated with the type. # Its the definitions of this property that determine the bound or the virtual type. @@ -1389,7 +1397,7 @@ end # Note that parameter types are shared among class refinements. # Therefore parameter only have an internal name (see `to_s` for details). class MParameterType - super MType + super MFormalType # The generic class where the parameter belong var mclass: MClass -- 1.7.9.5