aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo G. Giarrusso <p.giarrusso@gmail.com>2016-11-07 20:46:10 +0100
committerPaolo G. Giarrusso <p.giarrusso@gmail.com>2016-11-07 21:07:49 +0100
commiteec0e9b2111208c6f0bab8ec5d06c63e4432fb9e (patch)
tree2aff4c97437b440456912a91b50f1e69fb6ac20b
parent5cef7a9098422dd568e9bc7e8eb5c9e4f04d4396 (diff)
downloaddotty-eec0e9b2111208c6f0bab8ec5d06c63e4432fb9e.tar.gz
dotty-eec0e9b2111208c6f0bab8ec5d06c63e4432fb9e.tar.bz2
dotty-eec0e9b2111208c6f0bab8ec5d06c63e4432fb9e.zip
Resync copy of the type diagram in docs
Also add a note that the two diagrams should be kept in sync, both ways, so there's a chance that the copies are kept in sync. Alternatively one could drop a copy.
-rw-r--r--docs/docs/internals/type-system.md11
-rw-r--r--src/dotty/tools/dotc/core/Types.scala2
2 files changed, 10 insertions, 3 deletions
diff --git a/docs/docs/internals/type-system.md b/docs/docs/internals/type-system.md
index e86e07fd1..e3a563c21 100644
--- a/docs/docs/internals/type-system.md
+++ b/docs/docs/internals/type-system.md
@@ -13,6 +13,8 @@ A type which inherits `TypeProxy` is a proxy for another type accessible using
the `underlying` method, other types are called _ground_ types and inherit
`CachedGroundType` or `UncachedGroundType`.
+Here's a diagram, copied from [dotty/tools/dotc/core/Types.scala][1]:
+
```
Type -+- ProxyType --+- NamedType ----+--- TypeRef
| | \
@@ -22,19 +24,22 @@ Type -+- ProxyType --+- NamedType ----+--- TypeRef
| | +--- SuperType
| | +--- ConstantType
| | +--- MethodParam
- | | +--- RefinedThis
+ | | +----RecThis
+ | | +--- SkolemType
| +- PolyParam
- | +- RefinedType
+ | +- RefinedOrRecType -+-- RefinedType
+ | | -+-- RecType
+ | +- HKApply
| +- TypeBounds
| +- ExprType
| +- AnnotatedType
| +- TypeVar
+ | +- PolyType
|
+- GroundType -+- AndType
+- OrType
+- MethodType -----+- ImplicitMethodType
| +- JavaMethodType
- +- PolyType
+- ClassInfo
|
+- NoType
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index ce308412b..ae248295c 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -73,6 +73,8 @@ object Types {
* +- NoPrefix
* +- ErrorType
* +- WildcardType
+ *
+ * Note: please keep in sync with copy in `docs/docs/internals/type-system.md`.
*/
abstract class Type extends DotClass with Hashable with printing.Showable {