Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/hashCode/boolean.kt
T
Abduqodiri Qurbonzoda fd4d4f516f Fix data class hashcode generation
It considers Boolean hashCode equal to 1/0 for true/false,
which is different from actual hashCode of the Boolean type.
2023-06-14 08:19:47 +00:00

8 lines
169 B
Kotlin
Vendored

data class A(val a: Boolean)
fun box() : String {
if (A(true).hashCode() != 1231) return "fail1"
if (A(false).hashCode() != 1237) return "fail2"
return "OK"
}