Open ZacSweers opened 1 year ago
Removing the default value works around it for now
Gave this a quick try on MoshiX 0.27.1. The following seems to compile just fine:
@JsonClass(generateAdapter = true, generator = "sealed:type")
sealed class Message {
@TypeLabel("success")
@JsonClass(generateAdapter = true)
data class Success(
@Json(name = "value")
val value: Duration = 1.minutes
) : Message()
@DefaultObject
object Unknown : Message()
}
(Kotlin 1.9.21, KSP 1.9.21-1.0.16)
The following snippet seems to result in a compiler error, unsure if it's a bug in kotlinc or moshix doing something wrong
Results in this