title: Vert.x Kotlin Type Mismatch required Handler<AsyncResult<Unit>> found (Handler<AsyncResult<Unit>>) -> Unit
body: <p>The following is a method rewritten in Kotlin from Java:</p>
  
  <pre><code>fun publishMessageSource(
          name: String,
          address: String,
          completionHandler: Handler&lt;AsyncResult&lt;Unit&gt;&gt;
  ) {
      val record = MessageSource.createRecord(name, address)
      publish(record, completionHandler)
  }
  </code></pre>
  
  <p>However, when I call it as follows:</p>
  
  <pre><code>publishMessageSource("market-data", ADDRESS, { record: Handler&lt;AsyncResult&lt;Unit&gt;&gt; -&gt;
              if (!record.succeeded()) {
                  record.cause().printStackTrace()
              }
              println("Market-Data service published : ${record.succeeded()}")
          })
  </code></pre>
  
  <p>I get the error <code>Type Mismatch required Handler&lt;AsyncResult&lt;Unit&gt;&gt; found (Handler&lt;AsyncResult&lt;Unit&gt;&gt;) -&gt; Unit</code>.</p>
  
  <p>What am I doing wrong?</p>