CastedArrayListArgsBundler gives compilation errors.
See original GitHub issueI get the following error when trying to use CastedArrayListArgsBundler as a bundler for an Arraylist of parcelable object.
Error:(32, 35) error: incompatible types: List<CAP#1> cannot be converted to List<Foo> where CAP#1 is a fresh type-variable: CAP#1 extends Parcelable from capture of ? extends Parcelable
in my fragment
@Arg(bundler = CastedArrayListArgsBundler.class) List<Foo> foobar;
and my foo class
`public class Foo implements Parcelable { String happy;
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.happy);
}
public Foo() {
}
protected Foo(Parcel in) {
this.happy = in.readString();
}
public static final Parcelable.Creator<Foo> CREATOR = new Parcelable.Creator<Foo>() {
@Override
public Foo createFromParcel(Parcel source) {
return new Foo(source);
}
@Override
public Foo[] newArray(int size) {
return new Foo[size];
}
};
}`
the error is here in the Builder class
` public static final void injectArguments(@NonNull InterestRateDetailsFragment fragment) { Bundle args = fragment.getArguments(); if (args == null) { throw new IllegalStateException("No arguments set. Have you setup this Fragment with the corresponding FragmentArgs Builder? "); }
if (!args.containsKey("com.hannesdorfmann.fragmentargs.custom.bundler.2312A478rand.foobar")) {
throw new IllegalStateException("required argument foobar is not set");
}
fragment.foobar = bundler1.get("foobar", args); //<-------error here
}`
using latest gradle and build tools
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Thanks for reporting. It seems that this is a bug
This is fixed in latest
4.0.0-SNAPSHOT