Calling hashCode() on an array returns the identity hash code, not a hash based on the array's contents. This is almost never what you want.

To calculate the hash code for an array correctly, use:

Example:


  fun main() {
      val a1 = arrayOf<Any>()
      val hashcode = a1.hashCode() // incorrect
  }

After the quick-fix is applied:


  fun main() {
      val a1 = arrayOf<Any>()
      val hashcode = a1.contentHashCode() // correct
  }