Files
Ilmir Usmanov 8e8a6e6108 Do not count receivers in default parameters mask
If we implement default function with default parameters in inline
class, the receivers will be added to parameter list
(see ac7538a269). But since they
are not present in source parameters, we should not count them when we
compute mask for default parameters.

 #KT-49977 Fixed
2021-11-30 15:09:16 +00:00

24 lines
553 B
Kotlin
Vendored

// WITH_STDLIB
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
interface Path {
fun dispatch(s: String = "K") = "dispatch$s"
fun Int.extension(s: String = "K") = "${this}extension$s"
}
@JvmInline
value class RealPath(val x: Int) : Path
fun box(): String {
val rp = RealPath(1)
val res = "${rp.dispatch()};${rp.dispatch("KK")};" +
with(rp) {
"${1.extension()};${2.extension("KK")}"
}
if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res
return "OK"
}