I sit in front of the project for about 10,000 LoC. I need to upgrade this project from Scala 2.9 to 2.10. This was well done, but because of the manifest, I got a lot of warnings about deprecation.
After using the stackoverflow search function and many other sites, I don't have many questions. I want to summarize; key points:
TypeTags and ClassTags are much better than Manifests and ClassManifest. Especially you can use them as synonyms (TypeTags โ Manifests and ClassTags โ ClassManifest)
TypeTags are more powerful than ClassTags, respectively ClassTags are more limited to TypeTags. My first question: The manifest[T].erasure.getSimpleName method is often used in this project. Now I can not only switch this to typeTag[T].runtimeClass.getSimpleName , because the code will not compile, but with classTag[T].runtimeClass.getSimpleName it will compile. Will this affect semantics? (Note: the erasure method is also deprecated, you should use runtimeClass )
Second question: The manifest type check in Scala 2.9 was like: manifest[T] <:< manifest[A] . In Scala 2.10, I would write this typeOf[T] <:< typeOf[A] . But <:< out of date ?!
Is it possible to apply TypeTag to ClassTag? That is: If I use manifests only for type checking (No. 3) and extracting a name (No. 2): Can I rename each manifest / class manifest to ClassTag?
source share