title: Common supertype of methods
body: <p>Consider the following definitions:</p>
  
  <pre><code>trait Event
  case class Event1[A] extends Event
  case class Event2[A, B] extends Event
  /* ... */
  
  trait Filter { val cond: Event =&gt; Boolean }
  case class Filter1[A](cond: Event1[A] =&gt; Boolean) extends Filter
  case class Filter2[A, B](cond: Event2[A, B] =&gt; Boolean) extends Filter
   /* ... */
  </code></pre>
  
  <p>I think it is quite clear what I am trying to accomplish here: I want to make sure that whenever I encounter a <code>Filter</code>, it is guaranteed to have a <code>cond</code> function that takes the respective subtype of <code>Event</code> and gives me a Boolean. Obviously, the code above doesn't compile as, for example, <code>Event1[A] =&gt; Boolean</code> is not really a subtype of <code>Event =&gt; Boolean</code>. How would one solve such an issue?</p>