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
This commit is contained in:
committed by
Space Team
parent
f80ed4592d
commit
457837a255
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// WITH_STDLIB
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// LANGUAGE: +ValueClasses
|
||||
|
||||
// FILE: Point.kt
|
||||
|
||||
@JvmInline
|
||||
value class Point(val x: Int, val y: Int)
|
||||
|
||||
// FILE: JavaBase.java
|
||||
|
||||
public class JavaBase {
|
||||
public int foo(Point x)
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: JavaChild.java
|
||||
|
||||
public class JavaChild extends JavaBase {}
|
||||
|
||||
// FILE: KotlinChild.kt
|
||||
|
||||
class KotlinChild : JavaChild()
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
fun box(): String {
|
||||
if (JavaBase().foo(Point(0, 0)) != 42) return "Fail 1"
|
||||
if (JavaChild().foo(Point(0, 0)) != 42) return "Fail 2"
|
||||
if (KotlinChild().foo(Point(0, 0)) != 42) return "Fail 3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user