JVM IR: Minor fix for nullable SAM wrappers
This commit is contained in:
committed by
Alexander Udalov
parent
4d43c13fb1
commit
f2e0c1a930
+1
-1
@@ -92,7 +92,7 @@ class SingleAbstractMethodLowering(val context: CommonBackendContext) : FileLowe
|
|||||||
val instance = irCall(implementation.constructors.single()).apply {
|
val instance = irCall(implementation.constructors.single()).apply {
|
||||||
putValueArgument(0, irGet(invokableVariable))
|
putValueArgument(0, irGet(invokableVariable))
|
||||||
}
|
}
|
||||||
irIfNull(superType, irGet(invokableVariable), irNull(), instance)
|
+irIfNull(superType, irGet(invokableVariable), irNull(), instance)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
irCall(implementation.constructors.single()).apply { putValueArgument(0, invokable) }
|
irCall(implementation.constructors.single()).apply { putValueArgument(0, invokable) }
|
||||||
|
|||||||
+9
-2
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// FILE: JFoo.java
|
// FILE: JFoo.java
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -17,8 +16,16 @@ fun test() {
|
|||||||
JFoo.foo2({}, runnable())
|
JFoo.foo2({}, runnable())
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TestKt.class:
|
|
||||||
// 2 NEW
|
// 2 NEW
|
||||||
|
|
||||||
|
// JVM_TEMPLATES
|
||||||
|
// @TestKt.class:
|
||||||
// 0 IFNONNULL
|
// 0 IFNONNULL
|
||||||
// 1 IFNULL
|
// 1 IFNULL
|
||||||
// 1 ACONST_NULL
|
// 1 ACONST_NULL
|
||||||
|
|
||||||
|
// JVM_IR_TEMPLATES
|
||||||
|
// @TestKt.class
|
||||||
|
// 1 IFNONNULL
|
||||||
|
// 0 IFNULL
|
||||||
|
// 2 ACONST_NULL
|
||||||
|
|||||||
Reference in New Issue
Block a user