Hi there can somebody please advise me if there are any specific rules required for Kotlin class with enum? Simple example as
data class Passenger(
var type: Type?,
var id: Int,
var age: Int
) {
companion object {
const val AGE_NOT_SET = -1
}
enum class Type {
ADULT, CHILD, INFANT
}
constructor() : this(null, 0, 0)
}
If object get initialized to Passenger(CHILD, 123456, 4)
converted to Json and later on parsed back to POJO it will result in Passenger(null, 0,0)
I do have
-keepclassmembers,allowoptimization enum * {
public static **[] values(); public static ** valueOf(java.lang.String);
}
in my proguard rules that works for enum in Java but for some reason it fails for Kotlin