Skip to content

Commit

Permalink
Resync copy of the type diagram in docs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Blaisorblade committed Nov 7, 2016
1 parent 5cef7a9 commit eec0e9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/docs/internals/type-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
| | \
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit eec0e9b

Please sign in to comment.