2634303055
as it may have no primary constructor (only actual class has it). Refactor & rename Fir2IrGeneratorUtils.kt as having 'Fir' in stacktrace when actual K2 compiler is not used is very confusing. Fixes https://github.com/Kotlin/kotlinx.serialization/issues/2134 #KT-55683 Fixed
35 lines
716 B
Kotlin
Vendored
35 lines
716 B
Kotlin
Vendored
// IGNORE_BACKEND_K2: JVM_IR
|
|
// TARGET_BACKEND: JVM_IR
|
|
// !LANGUAGE: +MultiPlatformProjects
|
|
// WITH_STDLIB
|
|
|
|
// FILE: common.kt
|
|
|
|
package foo
|
|
|
|
import kotlinx.serialization.*
|
|
|
|
@Serializable
|
|
expect class Expected {
|
|
companion object { fun factoryMethod(): Expected }
|
|
}
|
|
|
|
// FILE: jvm.kt
|
|
|
|
package foo
|
|
|
|
import kotlinx.serialization.*
|
|
|
|
@Serializable
|
|
actual class Expected {
|
|
actual companion object { actual fun factoryMethod(): Expected = Expected() }
|
|
}
|
|
|
|
|
|
fun box(): String {
|
|
val b = Expected.factoryMethod()
|
|
if (b !is Expected) return "Incorrect factory method"
|
|
val desc = Expected.serializer().descriptor
|
|
if (desc.toString() != "foo.Expected()") return "Incorrect descriptor $desc"
|
|
return "OK"
|
|
} |