2

What is the difference in

trait MyTrait[T] {

  def doSomething() : T

}

and

trait MyTrait {

  type T

  def doSomething() : T

}

when you're implementing or mixing them in, it's looks almost the same. What are use-cases for using abstract type then?

intuitivepixel
  • 23,302
  • 3
  • 57
  • 51
jdevelop
  • 12,176
  • 10
  • 56
  • 112

0 Answers0