Skip to content

Commit

Permalink
Backport "remove implementation from asInstanceOf" to LTS (#20932)
Browse files Browse the repository at this point in the history
Backports #19753 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jul 2, 2024
2 parents fe088bb + dc8ccbf commit 01ca4ae
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions docs/_spec/12-the-scala-standard-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ abstract class Any {
def isInstanceOf[a]: Boolean

/** Type cast; needs to be inlined to work as given */ */
def asInstanceOf[A]: A = this match {
case x: A => x
case _ => if (this eq null) this
else throw new ClassCastException()
}
def asInstanceOf[A]: A
}

/** The root class of all value types */
Expand Down

0 comments on commit 01ca4ae

Please sign in to comment.