What is the proper way of using serialization with...
# serialization
e
What is the proper way of using serialization with
expect class
? I have the following class in the common module:
Copy code
expect class PlatformFileLocation
and this in the Android module:
Copy code
@Serializable
data class AndroidFileLocation(
    @Serializable(with = PathSerializer::class)
    val filePath: Path,
    val fileProviderAuthority: String
)

actual typealias PlatformFileLocation = AndroidFileLocation
If I mark the
PlatformFileLocation
as
@Serializable
I get an error. But without this I can’t get serializer in the common code. Is there any trick to make it work?
I tried to add
Copy code
expect class PlatformFileLocation {
    fun serializer(): KSerializer<PlatformFileLocation>
}
but in this case I get the following error in the android module:
Copy code
Actual class 'AndroidFileLocation' has no corresponding members for expected class members: 
public final expect fun serializer(): KSerializer<PlatformFileLocation> defined in com.tagbeam.core.platform_specific.PlatformFileLocation