title: Scala provide type information in subclassed generic function
body: <p>Here is my problem.</p>
  
  <p>I have an abstract class that defines a method with type parameters as input and output. I want the subclasses to provide the type information when subclassing but I want to do it in a way that I don't parametrize the whole class.</p>
  
  <p>Some pseudo code of what I'm aiming at.</p>
  
  <pre><code>abstract class A {
    def foo[T](t: T): T
  }
  
  class B() extends A {
    override foo[Int](t: Int): Int = t + 1
  }
  
  class C() extends A {
    override foo[Double](t: Double): Double = t + 1.0
  }
  </code></pre>
  
  <p>How do I pass the type information on subclassing? I looked at similar problems. They address that with self types, type classes and abstract types. </p>
  
  <p>Thanks </p>