I have some data transfer class which I want to share between platforms. There is only one difference. The implementations have different annotations on different platforms. What is the best way to do it? I know the only one way.
In the commonsMain:
expect class ErrorMessage (message: String = "") : DataTransferObject {
var message: String
}
In jvmMain:
@SomeJvmAnnotation
actual class ErrorMessage actual constructor (actual var message: String) : DataTransferObject
But if I implement every class this way than there is no profit from KMM. This way I need to implement every class n + 1 times where n is a number of platforms. Is there a simpler way to apply different annotations?
May be there is a way not to put expect on class.