mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
This matches the behavior of the JVM backend, with the exception of @JvmDefault methods, which are currently broken on the JVM backend.
37 lines
742 B
Kotlin
Vendored
37 lines
742 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
|
|
// IGNORE_BACKEND: JVM
|
|
// The JVM backend does not generate the g-impl method, but ends up calling it from box.
|
|
|
|
// !JVM_DEFAULT_MODE: enable
|
|
// JVM_TARGET: 1.8
|
|
// FILE: test.kt
|
|
|
|
|
|
fun box(): String {
|
|
val b = B(0)
|
|
return b.f() + b.g()
|
|
}
|
|
|
|
interface A {
|
|
fun f() = "O"
|
|
@JvmDefault
|
|
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;
|
|
// 0 public g\(\)Ljava/lang/String;
|
|
|
|
// 1 INVOKESTATIC B.g-impl \(I\)Ljava/lang/String;
|
|
|
|
// JVM_TEMPLATES:
|
|
// 2 INVOKESTATIC B.f-impl \(I\)Ljava/lang/String;
|
|
|
|
// JVM_IR_TEMPLATES:
|
|
// 1 INVOKESTATIC B.f-impl \(I\)Ljava/lang/String;
|