Observable.combineLatest type inference in kotlin : <p>I'm using RxJava2, Kotlin-1.1 along with RxBindings in my project.</p>

<p>I have simple login screen with 'login' button disabled by default, I want to enable the button only when username and password edittext fields are not empty.</p>

<p><strong>LoginActivity.java</strong></p>

<pre><code>Observable&lt;Boolean&gt; isFormEnabled =
    Observable.combineLatest(mUserNameObservable, mPasswordObservable,
        (userName, password) -&gt; userName.length() &gt; 0 &amp;&amp; password.length() &gt; 0)
        .distinctUntilChanged();
</code></pre>

<p>I'm unable to translate the above code from Java to Kotlin:</p>

<p><strong>LoginActivity.kt</strong></p>

<pre><code>class LoginActivity : AppCompatActivity() {

  val disposable = CompositeDisposable()

  private var userNameObservable: Observable&lt;CharSequence&gt;? = null
  private var passwordObservable: Observable&lt;CharSequence&gt;? = null

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_login)
    initialize()
  }

  fun initialize() {
    userNameObservable = RxTextView.textChanges(username).skip(1)
        .debounce(500, TimeUnit.MILLISECONDS)
    passwordObservable = RxTextView.textChanges(password).skip(1)
        .debounce(500, TimeUnit.MILLISECONDS) 
  }

  private fun setSignInButtonEnableListener() {
    val isSignInEnabled: Observable&lt;Boolean&gt; = Observable.combineLatest(userNameObservable,
        passwordObservable,
        { u: CharSequence, p: CharSequence -&gt; u.isNotEmpty() &amp;&amp; p.isNotEmpty() })
  }
}
</code></pre>

<p>I assumed it's something related to type inference of the third argument in <code>combinelatest</code>, but I don't get the issue properly by reading the error message: 
<a href="https://i.stack.imgur.com/obrG5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/obrG5.png" alt="Type Inference issue"></a></p>
