title: Understanding type inferrence in Scala
body: <p>I wrote the following simple program:</p>
  
  <pre><code>import java.util.{Set =&gt; JavaSet}
  import java.util.Collections._
  
  object Main extends App {
      def test(set: JavaSet[String]) = ()
  
      test(emptySet()) //fine
      test(emptySet) //error
  }
  </code></pre>
  
  <p><strong><a href="http://ideone.com/YtnGBy" rel="noreferrer"><em>DEMO</em></a></strong></p>
  
  <p>And was really surprised the the final line <code>test(emptySet)</code> was not compiled. Why? What is the difference between <code>test(emptySet())</code>? I thought in Scala we could omit parenthesis freely in such cases.</p>