Skip to content

Commit 01ca4ae

Browse files
Backport "remove implementation from asInstanceOf" to LTS (#20932)
Backports #19753 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents fe088bb + dc8ccbf commit 01ca4ae

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Diff for: docs/_spec/12-the-scala-standard-library.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,7 @@ abstract class Any {
6868
def isInstanceOf[a]: Boolean
6969

7070
/** Type cast; needs to be inlined to work as given */ */
71-
def asInstanceOf[A]: A = this match {
72-
case x: A => x
73-
case _ => if (this eq null) this
74-
else throw new ClassCastException()
75-
}
71+
def asInstanceOf[A]: A
7672
}
7773

7874
/** The root class of all value types */

0 commit comments

Comments
 (0)