We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The annotation processor generates invalid code for sealed classes.
This code:
@json sealed class LinkType { object Rotary : LinkType() object Prismatic : LinkType() companion object }
Generates this:
fun LinkType.toJson(): Json = JsObject(mapOf()) fun Json.Companion.toLinkType(value: Json): Either<DecodingError, LinkType> = Either.applicative<DecodingError>().map( , { -> LinkType() }).fix() fun LinkType.Companion.encoder() = object : Encoder<LinkType> { override fun LinkType.encode(): Json = this.toJson() } fun LinkType.Companion.decoder() = object : Decoder<LinkType> { override fun decode(value: Json): Either<DecodingError, LinkType> = Json.toLinkType(value) }
Apart from the issue with the call to map(), it's not possible to construct a LinkType because it is a sealed class.
map()
LinkType
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The annotation processor generates invalid code for sealed classes.
This code:
Generates this:
Apart from the issue with the call to
map()
, it's not possible to construct aLinkType
because it is a sealed class.The text was updated successfully, but these errors were encountered: