Enum entry hashCode() should return identity hash code #KT-59223
This commit is contained in:
committed by
Space Team
parent
19c6622ff6
commit
d6867917c9
@@ -0,0 +1,8 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
enum class E {
|
||||
A, B
|
||||
}
|
||||
|
||||
// hashCode shouldn't always return ordinal: KT-59223
|
||||
fun box() = if (E.A.hashCode() == E.A.ordinal && E.B.hashCode() == E.B.ordinal) "FAIL" else "OK"
|
||||
Reference in New Issue
Block a user