JVM_IR: Fix inlining of interface methods
This commit is contained in:
committed by
max-kammerer
parent
bdec8b04e8
commit
9816e62d08
@@ -523,7 +523,8 @@ fun createStaticFunctionWithReceivers(
|
||||
oldFunction.visibility,
|
||||
Modality.FINAL,
|
||||
oldFunction.returnType,
|
||||
isInline = false, isExternal = false, isTailrec = false, isSuspend = false
|
||||
isInline = oldFunction.isInline,
|
||||
isExternal = false, isTailrec = false, isSuspend = false
|
||||
).apply {
|
||||
descriptor.bind(this)
|
||||
parent = irParent
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
interface A {
|
||||
private inline fun <reified T> callDefault(b: () -> String): String {
|
||||
"String" is T
|
||||
return b()
|
||||
}
|
||||
|
||||
fun ok() = callDefault<String> { "OK" }
|
||||
}
|
||||
|
||||
class B : A
|
||||
|
||||
fun box(): String {
|
||||
return B().ok()
|
||||
}
|
||||
|
||||
// 0 INVOKESTATIC A$DefaultImpls.callDefault
|
||||
@@ -2277,6 +2277,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("interfaceDefaultMethod.kt")
|
||||
public void testInterfaceDefaultMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inline/interfaceDefaultMethod.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("linenumberForOneParametersArgumentCall.kt")
|
||||
public void testLinenumberForOneParametersArgumentCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inline/linenumberForOneParametersArgumentCall.kt");
|
||||
|
||||
+5
@@ -2247,6 +2247,11 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("interfaceDefaultMethod.kt")
|
||||
public void testInterfaceDefaultMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inline/interfaceDefaultMethod.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("linenumberForOneParametersArgumentCall.kt")
|
||||
public void testLinenumberForOneParametersArgumentCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inline/linenumberForOneParametersArgumentCall.kt");
|
||||
|
||||
Reference in New Issue
Block a user