# Pre-SIP: deprecate asInstanceOf, introduce unsafeAsInstanceOf

**URL:** <https://contributors.scala-lang.org/t/pre-sip-deprecate-asinstanceof-introduce-unsafeasinstanceof/6568>\
**Category:** Scala Improvement Process\
**Created:** [February 21, 2024, 9:17am UTC](https://contributors.scala-lang.org/t/pre-sip-deprecate-asinstanceof-introduce-unsafeasinstanceof/6568 "2024-02-21T09:17:29Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![Stephane](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/stephane/32/2370_2.png) [@Stephane](https://contributors.scala-lang.org/u/Stephane)\
**Post date:** [February 21, 2024, 5:59pm UTC](https://contributors.scala-lang.org/t/pre-sip-deprecate-asinstanceof-introduce-unsafeasinstanceof/6568/22 "2024-02-21T17:59:14Z")

</div>

There is little effective documentation for `asInstanceOf`.

1. Most people won’t look at the spec ([which is wrong anyways](https://contributors.scala-lang.org/t/this-trick-enables-overloading-for-opaque-types/6560/17)).
2. My version of IntelliJ, which is up to date and working otherwise, does not provide any documentation for `asInstanceOf`, and I can imagine that many other Scala developers don’t have immediate access to it, and might not even be aware that it exists, given how hard it is to find online.
3. Googling ‘scala asinstanceof’ does not return any official documentation in the top results.

I can imagine that a dedicated documentation page, with several examples and pitfalls, could be quite helpful to many people.

---

_[View the full topic](https://contributors.scala-lang.org/t/pre-sip-deprecate-asinstanceof-introduce-unsafeasinstanceof/6568)._
