You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to serialize a third party class through use of the experimental serialization API @Serializer(forClass = Class::class). The trouble I am having is, most of the times this works but it would at times just randomly fail to compile even without having done any changes. The error I get is Cannot generate external serializer 'data class Example : Any': class 'com.example.Example' have constructor parameters which are not properties and therefore it is not serializable automatically
Example class is one that has been generated by a flutter tool called pigeon pub.dev and github repository
To Reproduce
An example of a class that would be generated by pigeon is
/** * Represents an exception that occurred during a task execution. * * Generated class from Pigeon that represents data sent in messages.*/data classTaskException (
/** The error code of the exception. */valcode:TaskErrorCode,
/** The error message of the exception. */valmessage:String,
/** * The response from the server that caused the exception. If provided, the * exception is considered to be as a result of a failed HTTP request.*/valrawResponse:String? = null
)
{
companionobject {
funfromList(pigeonVar_list:List<Any?>): TaskException {
val code = pigeonVar_list[0] asTaskErrorCodeval message = pigeonVar_list[1] asStringval rawResponse = pigeonVar_list[2] asString?returnTaskException(code, message, rawResponse)
}
}
funtoList(): List<Any?> {
returnlistOf(
code,
message,
rawResponse,
)
}
}
Describe the bug
Trying to serialize a third party class through use of the experimental serialization API @Serializer(forClass = Class::class). The trouble I am having is, most of the times this works but it would at times just randomly fail to compile even without having done any changes. The error I get is
Cannot generate external serializer 'data class Example : Any': class 'com.example.Example' have constructor parameters which are not properties and therefore it is not serializable automatically
Example class is one that has been generated by a flutter tool called pigeon pub.dev and github repository
To Reproduce
An example of a class that would be generated by pigeon is
And the following is how I use the serializer
Expected behavior
Environment
The text was updated successfully, but these errors were encountered: