Enum entry hashCode() should return identity hash code #KT-59223

This commit is contained in:
Abduqodiri Qurbonzoda
2023-06-11 03:14:57 +03:00
committed by Space Team
parent 19c6622ff6
commit d6867917c9
17 changed files with 96 additions and 4 deletions
@@ -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"