Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/javaInterop/methodWithInlineClassInheritedBothFromJavaAndKotlin.kt
T
vladislav.grechko 457837a255 Fix function invocation mangling rule
Mangle invocations of functions with value classes in signature which
override (directly or indirectly) a method declared in Kotlin code.
Otherwise, NoSuchMethodError is being thrown.

^KT-55945: Fixed
2023-06-15 09:34:21 +00:00

34 lines
597 B
Kotlin
Vendored

// WITH_STDLIB
// TARGET_BACKEND: JVM_IR
// FILE: KotlinInterface.kt
public interface KotlinInterface {
fun foo(x: UInt): Int
}
// FILE: JavaInterface.java
import kotlin.UInt;
public interface JavaInterface {
int foo(UInt x);
}
// FILE: JavaInterfaceChildOfKotlin.java
public interface JavaInterfaceChildOfKotlin extends KotlinInterface {}
// FILE: KotlinChild.kt
class KotlinChild : JavaInterface, JavaInterfaceChildOfKotlin {
override fun foo(x: UInt) = 42
}
// FILE: box.kt
fun box(): String {
if (KotlinChild().foo(0.toUInt()) != 42) return "Fail"
return "OK"
}