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,092
  • 3
  • 53
  • 51
jdevelop
  • 11,517
  • 9
  • 48
  • 103

0 Answers0