X Tutup
Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Parcelable generic argument doesn't work in @FragmentArg  #1484

@pashky

Description

@pashky

Hi, I'm experiencing some trouble with generated code, if @efragment is generic.

For example, if I have following declaration:

@EFragment
public class ChoiceDialog<PayloadType extends Parcelable> extends Fragment {
    @FragmentArg 
    PayloadType payload;
     ...
}

Generated build then still tries to put Serializable into bundle:

        public ChoiceDialog_.FragmentBuilder_ payload(PayloadType callbackData) {
            args.putSerializable(PAYLOAD_ARG, callbackData);
            return this;
        }

I hope it's possible to find out upper bound from generics declaration and fix it, so it will put correct type. I'm fairly okay to revert to PayloadType extends Serializable in my case, which would work as putSerializable seems to be default, but still it would be nice to see it fixed in future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup