mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 15:53:40 +00:00
1. Postpone the computation of the signature for property reference getters for extension properties until codegen time. 2. Generate metadata for static replacement functions instead of the original functions.
41 lines
1.0 KiB
Kotlin
Vendored
41 lines
1.0 KiB
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// IGNORE_BACKEND: JS_IR, JS, NATIVE
|
|
// WITH_REFLECT
|
|
import kotlin.test.assertEquals
|
|
|
|
interface ITest {
|
|
fun test(a: String, b: S): String
|
|
}
|
|
|
|
inline class Z(val x: Int) : ITest {
|
|
override fun test(a: String, b: S) = "$x$a${b.x}"
|
|
}
|
|
|
|
inline class L(val x: Long) : ITest {
|
|
override fun test(a: String, b: S) = "$x$a${b.x}"
|
|
}
|
|
|
|
inline class S(val x: String) : ITest {
|
|
override fun test(a: String, b: S) = "$x$a${b.x}"
|
|
}
|
|
|
|
inline class A(val x: Any) : ITest {
|
|
override fun test(a: String, b: S) = "$x$a${b.x}"
|
|
}
|
|
|
|
fun box(): String {
|
|
assertEquals("42-+", Z::test.call(Z(42), "-", S("+")))
|
|
assertEquals("42-+", Z(42)::test.call("-", S("+")))
|
|
|
|
assertEquals("42-+", L::test.call(L(42L), "-", S("+")))
|
|
assertEquals("42-+", L(42L)::test.call("-", S("+")))
|
|
|
|
assertEquals("42-+", S::test.call(S("42"), "-", S("+")))
|
|
assertEquals("42-+", S("42")::test.call("-", S("+")))
|
|
|
|
assertEquals("42-+", A::test.call(A("42"), "-", S("+")))
|
|
assertEquals("42-+", A("42")::test.call("-", S("+")))
|
|
|
|
return "OK"
|
|
}
|