Skip to content

Commit 0a28853

Browse files
committed
Update doc page
1 parent 2e77d34 commit 0a28853

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/docs/reference/other-new-features/matchable.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,25 @@ extended by both `AnyVal` and `AnyRef`. Since `Matchable` is a supertype of ever
6363
- Type parameters and abstract types that are only bounded by some
6464
universal trait: Again, `Matchable` should be added as a bound.
6565

66+
Here is the hierarchy of toplevel classes and traits with their defined methods:
67+
```scala
68+
abstract class Any:
69+
def getClass
70+
def isInstanceOf
71+
def asInstanceOf
72+
def ==
73+
def !=
74+
def ##
75+
def equals
76+
def hashCode
77+
def toString
78+
79+
trait Matchable extends Any
80+
81+
class AnyVal extends Any, Matchable
82+
class Object extends Any, Matchable
83+
```
84+
6685
`Matchable` is currently a marker trait without any methods. Over time
6786
we might migrate methods `getClass` and `isInstanceOf` to it, since these are closely related to pattern-matching.
6887

0 commit comments

Comments
 (0)