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

30 lines
652 B
Kotlin
Vendored

// WITH_STDLIB
// !JVM_DEFAULT_MODE: compatibility
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
interface Path {
fun dispatch(maxDepth: Int = 42)
fun Int.extension(maxDepth: Int = 42)
}
@JvmInline
value class RealPath(val x: Int) : Path {
override fun dispatch(maxDepth: Int) = Unit
fun childrenDispatch(recursively: Boolean): Unit =
if (recursively) dispatch() else dispatch()
override fun Int.extension(maxDepth: Int) = Unit
fun Int.childrenExtension(recursively: Boolean): Unit =
if (recursively) extension() else extension()
}
fun box(): String {
RealPath(1)
return "OK"
}