From cba0cbb892e991a0946270d1a7da63993f248225 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Tue, 26 Jun 2012 11:00:26 +0200 Subject: Improves backward compatibility of manifests 1) type ClassManifest[T] = ClassTag[T] (solves a problem with toArray[T: ClassManifest] defined on most of the collections; if these types weren't aliases, then we won't be able to change the signature of that method to toArray[T: ClassTag], because that would break source compatibility for those who override toArray in their custom collections) 2) Compiler-generated manifests no longer trigger deprecation warnings (this is implemented by using ClassManifestFactory instead of ClassManifest and ManifestFactory instead of Manifest) 3) Deprecation messages got improved to reflect the changes that were introduced in 2.10.0-M4. --- test/files/neg/t3692-old.check | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test/files/neg/t3692-old.check') diff --git a/test/files/neg/t3692-old.check b/test/files/neg/t3692-old.check index a97a7d31ec..92d71f7e4e 100644 --- a/test/files/neg/t3692-old.check +++ b/test/files/neg/t3692-old.check @@ -1,8 +1,11 @@ -t3692-old.scala:6: warning: object Manifest in package reflect is deprecated: Use TypeTag instead - new ManifestTester().toJavaMap(map) - ^ +t3692-old.scala:11: warning: type Manifest in object Predef is deprecated: Use scala.reflect.ClassTag (to capture erasures) or scala.reflect.runtime.universe.TypeTag (to capture types) or both instead + private final def toJavaMap[T, V](map: Map[T, V])(implicit m1: Manifest[T], m2: Manifest[V]): java.util.Map[_, _] = { + ^ +t3692-old.scala:11: warning: type Manifest in object Predef is deprecated: Use scala.reflect.ClassTag (to capture erasures) or scala.reflect.runtime.universe.TypeTag (to capture types) or both instead + private final def toJavaMap[T, V](map: Map[T, V])(implicit m1: Manifest[T], m2: Manifest[V]): java.util.Map[_, _] = { + ^ t3692-old.scala:15: error: unreachable code case m2: Map[T, Int] => new java.util.HashMap[T, Integer] ^ -one warning found +two warnings found one error found -- cgit v1.2.3