electrolobzik
02/08/2024, 4:27 PMexpect class
?
I have the following class in the common module:
expect class PlatformFileLocation
and this in the Android module:
@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?electrolobzik
02/08/2024, 4:29 PMexpect class PlatformFileLocation {
fun serializer(): KSerializer<PlatformFileLocation>
}
but in this case I get the following error in the android module:
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