Files
kotlin/compiler/testData/codegen/box/dataClasses/hashCode/boolean.kt
Zalim Bashorov fb1c4320b6 KJS: check hashCode property only for objects to avoid extra boxing for primitive values
Also in Nashorn everything has hashCode including primitive types,
so the result can be different at Nashorn and at other engines.
2017-04-26 13:07:34 +03:00

8 lines
162 B
Kotlin
Vendored

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