Files
T
2021-10-11 12:09:52 +03:00

31 lines
729 B
Kotlin
Vendored

// WITH_RUNTIME
// !JVM_DEFAULT_MODE: all-compatibility
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
interface Path {
fun dispatch(maxDepth: Int = 42)
fun Int.extension(maxDepth: Int = 42)
}
@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE")
@kotlin.jvm.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"
}