title: I get an error when using existential types
body: <p>I was doing some experiments with existential types. First I defined a small class hierarchy:</p>
  
  <pre><code>trait Fruit
  case class Apple extends Fruit
  case class Banana extends Fruit
  </code></pre>
  
  <p>Then I wanted a set to which I could add different types of Fruit:</p>
  
  <pre><code>val set1: Set[_ &gt;: Fruit] = Set()
  // Which is equivalent to:
  val set2: Set[F] forSome { type F &gt;: Fruit } = Set()
  
  // This compiles
  set1 += Apple()
  set1 += Banana()
  set2 += Apple()
  set2 += Banana()
  </code></pre>
  
  <p>So far, so good. But now I want a set of functions from some Fruit to Unit:</p>
  
  <pre><code>// This still compiles
  val set3: Set[(_ &lt;: Fruit) =&gt; Unit] = Set()
  // But this doesn't
  val set4: Set[F =&gt; Unit] forSome { type F &lt;: Fruit } = Set()
  </code></pre>
  
  <p>That last line gives me the following errors:</p>
  
  <ul>
  <li>no type parameters for method apply: (elems: A*)scala.collection.mutable.Set[A] in class GenericCompanion exist so that it can be applied to arguments () --- because --- undetermined type</li>
  <li>type mismatch; found : scala.collection.mutable.Set[A] required: scala.collection.mutable.Set[F => Unit] forSome { type F &lt;: Fruit }</li>
  </ul>
  
  <p>Why do I get those errors, when supposedly my set4 is equivalent to set3? Did I made a mistake somewhere?</p>
  
  <p>If I say Set[(F forSome { F &lt;: Fruit }) => Unit] then that lines compiles, but I can't add functions to that set:</p>
  
  <ul>
  <li>type mismatch; found : Apple => Unit required: F forSome { type F &lt;: Fruit } => Unit</li>
  </ul>
  
  <p>Where I can add the same function to set3 with no problem.</p>
  
  <p>Another problem I had is that I can't put the existential types on the right side of the assignment:</p>
  
  <pre><code>// Does not compile, I get "unbound wildcard type"
  val set1 = Set[_ &gt;: Fruit]()
  </code></pre>
  
  <p>Why is that?</p>