title: Kotlin How to use custom click listener with lambda instead of declaring object : CustomClass
body: <p>This is my interface:</p>
  
  <pre><code>interface DialogOkClickListener {
      fun onDialogOkClick()
  }
  </code></pre>
  
  <p>This is my clickListener</p>
  
  <pre><code>fun setOkClickListener(okClickListener: DialogOkClickListener): DialogOkCancel {
      this.okClickListener = okClickListener
      return this
  }
  </code></pre>
  
  <p>This is how it currently works:</p>
  
  <pre><code> .setOkClickListener(object  : DialogOkCancel.DialogOkClickListener{
       override fun onDialogOkClick() {
           TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
       }
   })
  </code></pre>
  
  <p>But if I try something like: </p>
  
  <pre><code> .setCancelClickListener{ methodToCall() }
  </code></pre>
  
  <p>I get <code>type missmatch found () -&gt; String</code></p>