2ae2f09fee
Phase COMPILER_REQUIRED_ANNOTATIONS causes errors in the kotlinx serialization tests: org.jetbrains.kotlin.fir.symbols.FirLazyResolveContractViolationException: `lazyResolveToPhase(COMPILER_REQUIRED_ANNOTATIONS)` cannot be called from a transformer with a phase COMPILER_REQUIRED_ANNOTATIONS. `lazyResolveToPhase` can be called only from a transformer with a phase which is strictly greater than a requested phase; i.e., `lazyResolveToPhase(A)` may be only called from a lazy transformer with a phase B, where A < B. This is a contract of lazy resolve
20 lines
440 B
Kotlin
Vendored
20 lines
440 B
Kotlin
Vendored
// WITH_STDLIB
|
|
|
|
import kotlinx.serialization.*
|
|
import kotlinx.serialization.json.*
|
|
import kotlinx.serialization.internal.*
|
|
|
|
@Serializable
|
|
@JvmInline
|
|
value class Foo(val i: Int)
|
|
|
|
@Serializable
|
|
class Holder(val f: Foo)
|
|
|
|
fun box(): String {
|
|
if(!Foo.serializer().descriptor.isInline) return "Incorrect descriptor"
|
|
val s = Json.encodeToString(Holder.serializer(), Holder(Foo(42)))
|
|
if (s != """{"f":42}""") return s
|
|
return "OK"
|
|
}
|