title: Inherit generic attributes in Scala
body: <p>Given the following <code>class</code> and <code>trait</code>, what I am trying to achieve is create a subclass with a specific type of its own i.e. <code>Engage</code> and <code>Event</code>. This is what I have as of now:</p>
  
  <pre><code>trait ATrait extends scala.AnyRef {
     val test: Option[String]
  }
  </code></pre>
  
  <p>I am able to achieve the following but to not much use (since the class is <code>abstract</code> still)</p>
  
  <pre><code>// this is made 'abstract' by me (can be edited)
  abstract class BaseSchema[T, P] extends ATrait {
    val test: Option[String]
    val data: T
    val parent: P
  }
  
  abstract class SubClass(override val data: Engage,
                          override val parent: Event
                         ) extends BaseSchema [Engage, Event]
  </code></pre>
  
  <p>If I convert the SubClass to a <code>class</code> or a <code>case class</code> I would have to implement all abstract members. </p>
  
  <p>What is the correct way of dealing with this in scala? In Java, one could have done</p>
  
  <pre><code>abstract class BaseSchema&lt;T,P&gt; {
      T data;
      P parent;
  }
  
  class SubClass extends BaseSchema&lt;Engage, Event&gt; {
  }
  
  class Engage{} class Event{}
  
  SubClass subClass = new SubClass();
  Engage eng = subClass.data;
  </code></pre>