title: Cannot choose among the following candidates without completing type inference
body: <p>I have these three helper extensions: </p>
  
  <pre><code>fun &lt;T, K : BaseViewHolder&gt; BaseQuickAdapter&lt;T, K&gt;.onItemClick(
          onItemClick: (adapter: BaseQuickAdapter&lt;*, *&gt;, position: Int, item: T) -&gt; Unit
  ): BaseQuickAdapter&lt;T, K&gt; {
      setOnItemClickListener { adapter, _, position -&gt;
          onItemClick(adapter, position, data[position])
      }
      return this
  }
  
  fun &lt;T, K : BaseViewHolder&gt; BaseQuickAdapter&lt;T, K&gt;.onItemClick(
          onItemClick: (position: Int, item: T) -&gt; Unit
  ): BaseQuickAdapter&lt;T, K&gt; =
          onItemClick { _, position, item -&gt; onItemClick(position, item) }
  
  fun &lt;T, K : BaseViewHolder&gt; BaseQuickAdapter&lt;T, K&gt;.onItemClick(
          onItemClick: (item: T) -&gt; Unit
  ): BaseQuickAdapter&lt;T, K&gt; =
          onItemClick { _, item -&gt; onItemClick(item) }
  </code></pre>
  
  <p>every <code>onItemClick</code> function takes one argument less that the previous one</p>
  
  <p>when I call:</p>
  
  <pre><code>onItemClick { item -&gt;  
  }
  </code></pre>
  
  <p>everything works fine as expected and the last method is called.</p>
  
  <p>but when I remove the explicit <code>item</code> ad try to use <code>it</code> </p>
  
  <pre><code>onItemClick {
      it.doStuff()
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Cannot choose among the following candidates without completing type inference:
  public fun &lt;T, K : BaseViewHolder&gt; BaseQuickAdapter&lt;T#1 (type parameter of humazed.github.com.kotlinandroidutils.simpleAdapter), KBaseViewHolder&gt;.onItemClick(onItemClick: (adapter: BaseQuickAdapter&lt;*, *&gt;, position: Int, item: T#1) → Unit): BaseQuickAdapter&lt;T#1, KBaseViewHolder&gt; defined in humazed.github.com.kotlinandroidutils
  public fun &lt;T, K : BaseViewHolder&gt; BaseQuickAdapter&lt;T#1, KBaseViewHolder&gt;.onItemClick(onItemClick: (item: T#1) → Unit): BaseQuickAdapter&lt;T#1, KBaseViewHolder&gt; defined in humazed.github.com.kotlinandroidutils
  public fun &lt;T, K : BaseViewHolder&gt; BaseQuickAdapter&lt;T#1, KBaseViewHolder&gt;.onItemClick(onItemClick: (position: Int, item: T#1) → Unit): BaseQuickAdapter&lt;T#1, KBaseViewHolder&gt; defined in humazed.github.com.kotlinandroidutils
  </code></pre>
  
  <p>the full <a href="https://github.com/humazed/KotlinAndroidUtils/blob/03aea7aaa420af0cc2fc9bf924951e9fbb5ba3de/kotlin-android-utils/src/main/java/humazed/github/com/kotlinandroidutils/BaseRecyclerViewAdapterHelperUtils.kt#L33" rel="nofollow noreferrer">code on GitHub</a></p>
  
  <p>I'm aware there are similar questions on SOF but they are not the same as mine and the answers don't apply here.</p>