title: Generic lambda in custom binding adapter
body: <p>I have a custom binding adapter with an attribute <code>onSelectItem</code> that expects a <strong>generic</strong> lambda expression:</p>
  
  <pre><code>&lt;UsersSpinner
      &lt;!-- more things --&gt;
  
      app:onSelectItem="@{(item) -&gt; usersViewModel.select(item)}"/&gt;
  </code></pre>
  
  <p>This is the <code>UsersViewModel</code>'s <code>select</code> method's signature:</p>
  
  <pre><code>public void select(User user);
  </code></pre>
  
  <p><code>UsersSpinner</code> extends from <code>MyCustomSpinner&lt;T&gt;</code>. This is the binding adapter:</p>
  
  <pre><code>  @BindingAdapter("onSelectItem")
      public static &lt;T&gt; void setOnSelectItem(MyCustomSpinner&lt;T&gt; view, final OnSelectItem&lt;T&gt; onSelectItem) {
          view.setOnItemSelectedListener(new OnItemSelectedListener() {
              @Override
              public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
                  T item = (T) adapterView.getSelectedItem();
                  onSelectItem.onSelectItem(item);
              }
          });
      }
  </code></pre>
  
  <p>Problem is that <code>UsersViewModel.select(User u)</code> expects an user, but here:</p>
  
  <pre><code>@{(item) -&gt; viewModel.select(item)}
  </code></pre>
  
  <p><code>item</code> is not a <code>User</code>, but a <code>Object</code>, because the generic parameter of <code>OnSelectItem&lt;T&gt;</code> is not being "applied". So, there is no method <code>UsersViewModel.select(Object o)</code> and I get a compilation error.</p>