Skip to content
New issue

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

Parceler: Unable to find read/write generator for type java.util.List<EnumType> #368

Open
bkolarov opened this issue Feb 22, 2019 · 1 comment

Comments

@bkolarov
Copy link

Hello,
Parceler produces a compile time error when I use it on a Kotlin data class, that accepts an immutable list of enum values. Here is the concrete example:

@Parcel(Parcel.Serialization.BEAN)
data class FeaturesResponse @ParcelConstructor constructor(var features: List<FeatureResponse>)

enum class FeatureResponse {
    FEATURE_1, FEATURE_2,
    UNKNOWN
}

And here is the error I get:

: Parceler: Unable to find read/write generator for type java.util.List<? extends FeatureResponse> for java.util.List<? extends FeatureResponse> features java.util.List<? extends FeatureResponse> features) {
                                                                                                       ^
e: /EnabledFeaturesResponse.java:12: error: Parceler: Types do not match for property features java.util.List<? extends FeatureResponse> java.util.List<FeatureResponse> public final java.util.List<FeatureResponse> getFeatures() {                                                                                                      ^

I think a possible workaround is to replace List With MutableList as the error doesn't appear then, but the issue remains.

@johncarl81
Copy link
Owner

This was reported recently here: #366. I have a reproducible failing test case if you want to try your hand at a fix PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants