Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/javaInterop/methodWithInlineClassInheritedInJavaOverriddenInKotlin.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

28 lines
529 B
Kotlin
Vendored

// WITH_STDLIB
// TARGET_BACKEND: JVM_IR
// FILE: KotlinBase.kt
open class KotlinBase {
open fun foo(x : UInt) = 42
}
// FILE: JavaChild.java
public class JavaChild extends KotlinBase {}
// FILE: KotlinChild.kt
class KotlinChild : JavaChild() {
override fun foo(x : UInt) = 24
}
// FILE: box.kt
fun box(): String {
if (KotlinBase().foo(0.toUInt()) != 42) return "Fail 1"
if (JavaChild().foo(0.toUInt()) != 42) return "Fail 2"
if (KotlinChild().foo(0.toUInt()) != 24) return "Fail 3"
return "OK"
}