Skip to content

Commit c4f2024

Browse files
authored
Merge pull request #1678 from Blaisorblade/sync-diagrams
Resync copy of the type diagram in docs
2 parents d60f89d + eec0e9b commit c4f2024

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

docs/docs/internals/type-system.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ A type which inherits `TypeProxy` is a proxy for another type accessible using
1313
the `underlying` method, other types are called _ground_ types and inherit
1414
`CachedGroundType` or `UncachedGroundType`.
1515

16+
Here's a diagram, copied from [dotty/tools/dotc/core/Types.scala][1]:
17+
1618
```
1719
Type -+- ProxyType --+- NamedType ----+--- TypeRef
1820
| | \
@@ -22,19 +24,22 @@ Type -+- ProxyType --+- NamedType ----+--- TypeRef
2224
| | +--- SuperType
2325
| | +--- ConstantType
2426
| | +--- MethodParam
25-
| | +--- RefinedThis
27+
| | +----RecThis
28+
| | +--- SkolemType
2629
| +- PolyParam
27-
| +- RefinedType
30+
| +- RefinedOrRecType -+-- RefinedType
31+
| | -+-- RecType
32+
| +- HKApply
2833
| +- TypeBounds
2934
| +- ExprType
3035
| +- AnnotatedType
3136
| +- TypeVar
37+
| +- PolyType
3238
|
3339
+- GroundType -+- AndType
3440
+- OrType
3541
+- MethodType -----+- ImplicitMethodType
3642
| +- JavaMethodType
37-
+- PolyType
3843
+- ClassInfo
3944
|
4045
+- NoType

src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ object Types {
7373
* +- NoPrefix
7474
* +- ErrorType
7575
* +- WildcardType
76+
*
77+
* Note: please keep in sync with copy in `docs/docs/internals/type-system.md`.
7678
*/
7779
abstract class Type extends DotClass with Hashable with printing.Showable {
7880

0 commit comments

Comments
 (0)