Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

@BindListener fails in class with generic parameters #16

Open
gantonious opened this issue Dec 30, 2016 · 0 comments
Open

@BindListener fails in class with generic parameters #16

gantonious opened this issue Dec 30, 2016 · 0 comments
Labels

Comments

@gantonious
Copy link
Owner

The following class:

public abstract class BaseViewCell<TModel> extends AbstractViewCell<BaseViewHolder> {
    @BindListener
    public void bindListener(BaseViewHolder viewHolder, Object listener) {

    }
}

Will generate this ListenerBinder:

public class BaseViewCell_ListenerBinder implements ListenerBinder<BaseViewCell<TModel>, BaseViewHolder> {
  @Override
  public void bindListeners(BaseViewCell<TModel> viewCell, BaseViewHolder viewHolder,
      ListenerCollection listenerCollection) {

    Object listener0 = listenerCollection.getListener(Object.class);
    if (listener0 != null) {
      viewCell.bindListener(viewHolder, listener0);
    }
  }
}

We need to replace all TModel instances with wildcards.

@gantonious gantonious added the bug label Dec 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant