nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model: introduce MFormalType as a superclass of MVirtualType and MParameterType
[nit.git]
/
src
/
model
/
model.nit
diff --git
a/src/model/model.nit
b/src/model/model.nit
index
76a3839
..
a5aeb76
100644
(file)
--- a/
src/model/model.nit
+++ b/
src/model/model.nit
@@
-1259,9
+1259,17
@@
class MGenericType
end
end
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
# 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.
# 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
# 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
# The generic class where the parameter belong
var mclass: MClass