Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt
T
2021-10-08 07:24:41 +03:00

23 lines
401 B
Kotlin
Vendored

// MODULE: lib
// FILE: lib.kt
inline class Z private constructor(private val value: Any?) {
fun result(): String = value as String
companion object {
fun create(value: Any?): Z = Z(value)
}
}
fun interface IFoo<T> {
fun foo(x: T): String
}
fun foo1(fs: IFoo<Z>) = fs.foo(Z.create("OK"))
// MODULE: main(lib)
// FILE: main.kt
fun box(): String =
foo1 { it.result() }