Josh Kenny
08/22/2024, 2:49 PMpublic typealias SerializablePVector<E> = @Serializable(with = PVectorSerializer::class) PVector<E>
// Obtain serializer later in different class with
val s = json.serializersModule.serializer<T>()
// Or to reproduce more directly...
val ps = json.serializersModule.serializer<SerializablePVector<Int>>()
This is working in Kotlin 1.9.23, but no longer finds PVectorSerializer
after updating to Kotin 2. I tried a few versions with the latest being Kotlin 2.0.20RC2, and kotlinx-serialization-json: 1.7.1 and they all find a polymorphic serializer rather than PVectorSerializer
. I can use PVectorSerializer
explicitly if this isn't supported but was hoping to confirm that it's expected to work this way after the update.