diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/DescriptorAsmUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/DescriptorAsmUtil.java index b2b467be99a..e007b177897 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/DescriptorAsmUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/DescriptorAsmUtil.java @@ -588,14 +588,6 @@ public class DescriptorAsmUtil { else if (type.getSort() == Type.OBJECT) { iv.invokevirtual("java/lang/Object", "hashCode", "()I", false); } - else if (type.getSort() == Type.BOOLEAN) { - Label end = new Label(); - iv.dup(); - iv.ifeq(end); - iv.pop(); - iv.iconst(1); - iv.mark(end); - } else { HashCode.Companion.invokeHashCode(iv, type); } diff --git a/compiler/testData/codegen/box/dataClasses/hashCode/boolean.kt b/compiler/testData/codegen/box/dataClasses/hashCode/boolean.kt index e231e75a57b..455310675c5 100644 --- a/compiler/testData/codegen/box/dataClasses/hashCode/boolean.kt +++ b/compiler/testData/codegen/box/dataClasses/hashCode/boolean.kt @@ -1,7 +1,7 @@ data class A(val a: Boolean) fun box() : String { - if (A(true).hashCode() != 1) return "fail1" - if (A(false).hashCode() !=0) return "fail2" + if (A(true).hashCode() != 1231) return "fail1" + if (A(false).hashCode() != 1237) return "fail2" return "OK" } diff --git a/compiler/testData/codegen/bytecodeText/jvm8/hashCode/dataClass.kt b/compiler/testData/codegen/bytecodeText/jvm8/hashCode/dataClass.kt index b1afb5de8fa..a92f189c427 100644 --- a/compiler/testData/codegen/bytecodeText/jvm8/hashCode/dataClass.kt +++ b/compiler/testData/codegen/bytecodeText/jvm8/hashCode/dataClass.kt @@ -13,8 +13,8 @@ data class Hash( ) -// 8 \.hashCode -// 0 INVOKESTATIC java/lang/Boolean\.hashCode \(Z\)I +// 9 \.hashCode +// 1 INVOKESTATIC java/lang/Boolean\.hashCode \(Z\)I // 1 INVOKESTATIC java/lang/Byte\.hashCode \(B\)I // 1 INVOKESTATIC java/lang/Character\.hashCode \(C\)I // 1 INVOKESTATIC java/lang/Short\.hashCode \(S\)I