JVM_IR: do not copy defaults in functions with inline class parameters
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// FILE: a.kt
|
||||
fun box() = A(0).f()
|
||||
|
||||
// FILE: b.kt
|
||||
inline class A(val i: Int)
|
||||
|
||||
fun A.f(xs: Array<String> = Array<String>(1) { "OK" }) = xs[i]
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.reflect.jvm.reflect
|
||||
|
||||
inline class C(val x: Int)
|
||||
|
||||
fun C.f(x: (String) -> Unit = { OK: String -> }) = x.reflect()?.parameters?.singleOrNull()?.name
|
||||
|
||||
fun box(): String = C(0).f() ?: "null"
|
||||
Reference in New Issue
Block a user