title: Scala: Inherited enum object doesn't satisfy parent trait
body: <p>I am trying to use an Enumeration object in a method. The enum object extends from a trait, and the method takes the trait as a parameter. Here is the sample code.</p>
  <pre><code>sealed trait canAdd
  object DAdder extends Enumeration with canAdd
  {
      type DAdder = Value
      val  P, Q = Value
  }
  
  class ClassTypeTest extends AnyFlatSpec with Matchers
  {
      class AClass
      {
          def add(v: canAdd) = if(v.isInstanceOf[DAdder]) println(&quot;Got DAdder&quot;) else println(&quot;Got IAdder&quot;)
          def note(v: canAdd) = println(&quot;Got some canAdd trait object&quot;)
      }
      val aobj = new AClass
      val aseq: Seq[DAdder] = Seq(DAdder.P, DAdder.Q, DAdder.P)
      //*** Error in below line *****    
      aseq.foreach(aobj.add(_))
  }
  </code></pre>
  <p>The compiler gives the following error:</p>
  <pre><code>Error:(23, 23) type mismatch;
   found   : x.x.DAdder.DAdder
      (which expands to)  x.x.DAdder.Value
   required: x.x.canAdd
      aseq.map(aobj.add(_))
  </code></pre>
  <p>Shouldn't I be able to pass an object that inherits the trait in a method that takes the trait as an argument? How do I fix this?</p>