Get rid of redundant boxing when comparing inline class instances
^KT-33722: Fixed
This commit is contained in:
committed by
teamcity
parent
e5ce32feeb
commit
5ec2f1ad92
+5
-1
@@ -9,6 +9,10 @@ fun testZ(z: Z, a: Any?) = z.equals(a)
|
||||
fun testNZ(z: Z?) = z?.equals(z)
|
||||
|
||||
// @TestKt.class:
|
||||
// JVM_IR_TEMPLATES
|
||||
// 0 INVOKESTATIC Z\$Erased\.equals
|
||||
// 0 INVOKESTATIC Z\-Erased\.equals
|
||||
// 3 INVOKESTATIC Z\.equals-impl \(ILjava/lang/Object;\)Z
|
||||
// 1 INVOKESTATIC Z\.equals-impl0 \(II\)Z
|
||||
// 1 INVOKESTATIC Z\.equals-impl \(ILjava/lang/Object;\)Z
|
||||
// 1 INVOKEVIRTUAL Z.equals
|
||||
// 0 INVOKEVIRTUAL Z.unbox-impl
|
||||
@@ -0,0 +1,17 @@
|
||||
// WITH_STDLIB
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
fun foo() {
|
||||
val result = Result.success("yes!")
|
||||
val other = Result.success("nope")
|
||||
|
||||
result == other
|
||||
result != other
|
||||
|
||||
result.equals(other)
|
||||
!result.equals(other)
|
||||
}
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// 0 INVOKESTATIC kotlin/Result.box-impl
|
||||
// 4 INVOKESTATIC kotlin/Result.equals-impl0
|
||||
Reference in New Issue
Block a user