JVM IR: fix HashCode intrinsic for generics substituted with primitives

The problem here was that although the IR type of the expression was
primitive, the type of the actual expression in the bytecode generated
after type erasure was `Ljava/lang/Object;`, and we were trying to call
a non-existing method `Object.hashCode(Object)`.

 #KT-41669 Fixed
This commit is contained in:
Alexander Udalov
2020-09-03 20:09:49 +02:00
parent c46c80822c
commit 3a5d0ab427
9 changed files with 49 additions and 2 deletions
@@ -16103,6 +16103,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/ir/genericCompanion.kt");
}
@TestMetadata("hashCodeOnGenericSubstitutedWithPrimitive.kt")
public void testHashCodeOnGenericSubstitutedWithPrimitive() throws Exception {
runTest("compiler/testData/codegen/box/ir/hashCodeOnGenericSubstitutedWithPrimitive.kt");
}
@TestMetadata("kt25405.kt")
public void testKt25405() throws Exception {
runTest("compiler/testData/codegen/box/ir/kt25405.kt");