Files
kotlin/compiler/testData/codegen/bytecodeText/inlineClasses/interfaceDefaultImplStubs.kt
Steven Schäfer 465e9f2d68 JVM IR: Always produce stubs for interface methods in inline classes
This matches the behavior of the JVM backend, with the exception of
@JvmDefault methods, which are currently broken on the JVM backend.
2020-02-28 14:48:17 +01:00

30 lines
712 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// FILE: test.kt
fun box(): String {
val b = B(0)
return b.f() + b.g()
}
interface A {
fun f() = "O"
fun g() = "K"
}
inline class B(val x: Int) : A
// 1 public static f-impl\(I\)Ljava/lang/String;
// 1 public f\(\)Ljava/lang/String;
// 1 public static g-impl\(I\)Ljava/lang/String;
// 1 public g\(\)Ljava/lang/String;
// JVM_TEMPLATES:
// The JVM backend calls f-impl, g-impl from f, g, respectively, in addition to the call from box.
// 2 INVOKESTATIC B.g-impl \(I\)Ljava/lang/String;
// 2 INVOKESTATIC B.f-impl \(I\)Ljava/lang/String;
// JVM_IR_TEMPLATES:
// 1 INVOKESTATIC B.g-impl \(I\)Ljava/lang/String;
// 1 INVOKESTATIC B.f-impl \(I\)Ljava/lang/String;