Scala Library
|
|
scala/Unhashable.scala
]
trait
Unhashable
extends
AnyRefA marker trait for data structures that cannot be hashed, for instance because they are mutable and at the same time support structural equality, so hashing them would lead to unpredictable results.
Such data structures have hashCode
throw an
java.lang.UnsupportedOperationException
. They retain
the original object hashcode with identityHashCode
.
Method Summary | |
override def
|
hashCode
: Int
The hashCode method always yields an error, since it is not
safe to use sets as keys in hash tables.
|
def
|
identityHashCode
: Int
The identity hash code is the original hash code inherited from Object.
|
Methods inherited from AnyRef | |
getClass, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
override
def
hashCode : Int
def
identityHashCode : Int
Scala Library
|
|