1

I am trying to understand the difference between 2 different pieces of code. What is the difference between T:Manifest and T?

I read about the manifests but didn't totally get it.

abstract class Def[+T]{
}

def findDefinition[T](d: Def[T]) ={
      //some code
}

def findDefinition[T:Manifest](d: Def[T]) = {
     //some code
}
Krzysztof Atłasik
  • 21,985
  • 6
  • 54
  • 76
PheniX Tylor
  • 41
  • 1
  • 4
  • Manifests are deprecated, so now it should be `[T: TypeTag]` https://docs.scala-lang.org/overviews/reflection/typetags-manifests.html – Dmytro Mitin Aug 08 '19 at 20:47
  • 1
    `[T:Manifest]` : `T` is "context bound" to `Manifest[T]`. See [here](https://stackoverflow.com/q/2982276/4993128). – jwvh Aug 08 '19 at 20:53

0 Answers0