Files
Ilmir Usmanov ac7538a269 Set receivers for inline class default function stub calls
Default function stubs have dispatch and receiver parameters, but
inline class methods are static by design with receivers as ordinary
parameters. So, take these parameters and set them as receivers during
lowerings.
 #KT-46230: Fixed
2021-07-12 19:46:09 +03:00

28 lines
620 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
interface Path {
fun dispatch(maxDepth: Int = 42)
fun Int.extension(maxDepth: Int = 42)
}
inline 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"
}