Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/privateConstructorFunInterfaceMultiModule.kt
T
Alexander Udalov 8d4f26cf84 IR: use inlineClassRepresentation in getInlineClassUnderlyingType
Looking for the primary constructor manually doesn't work if it's
private in the other module on JVM, because private declarations are
skipped in IrLazyClass.
2021-08-24 12:28:31 +02:00

24 lines
425 B
Kotlin
Vendored

// IGNORE_BACKEND: WASM
// 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() }