Skip to content

Commit

Permalink
remove implementation from asInstanceOf
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll authored and WojciechMazur committed Jul 1, 2024
1 parent 9dc1d97 commit 0d6dab5
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 0d6dab5

Please sign in to comment.