Support kotlinx.collections.immutable in kotlin-parcelize plugin

#KT-57685 Fixed

Co-authored-by: Ilya Gulya <ilyagulya@gmail.com>
This commit is contained in:
Ilya Gulya
2023-10-02 23:29:43 +00:00
committed by Space Team
parent e8853fd40b
commit f6b2c642c2
20 changed files with 416 additions and 54 deletions
@@ -44,7 +44,7 @@ interface ParcelSerializer {
val frameMap: FrameMap
) {
fun findParcelerClass(type: KotlinType): KotlinType? {
return typeParcelers.firstOrNull { it.first == type }?.second
return typeParcelers.firstOrNull { it.mappedType == type }?.parcelerType
}
}
@@ -10,7 +10,10 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
typealias TypeParcelerMapping = Pair<KotlinType, KotlinType>
data class TypeParcelerMapping(
val mappedType: KotlinType,
val parcelerType: KotlinType,
)
fun KotlinType.isParcelable() = matchesFqNameWithSupertypes(ParcelizeNames.PARCELABLE_FQN.asString())