title: How to return Unit from a scala function?
body: <p>I'm trying to make a function return Unit (this is to implement an RxScala observer), but when I add <code>()</code> to the end of it, I get an error "Application does not take parameters". Here's my code:</p>
  
  <pre><code>val client3MessageStreamObserver: Observable[Message] = client3.messageStream()
  client3MessageStreamObserver.subscribe(
    m =&gt; println("Unexpected message received by client3"),
    // callback for handling exceptions
    t =&gt;
      println("Ex client3: " + t)
  // want to make this line work (which it doesn't) which is why 
  // I need to be able to return Unit. 
  //        client3TestPromise.success(true)
      ()     // error after adding Unit literal here.
  )
  </code></pre>
  
  <p>Why do I get this error after adding <code>()</code> and how can I get rid of it? If I leave it out I get an error saying "Type mismatch: Expected (Throwable) => Unit, actual: (Throwable) => Any)".</p>