diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-06-26 11:00:26 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-07-02 11:44:50 +0200 |
commit | cba0cbb892e991a0946270d1a7da63993f248225 (patch) | |
tree | 47583676e4f3e7ad9e0288a373ee9fd9ac4d2cc4 /test/pending | |
parent | d14d8178fa39961951d7dd74a37994db86a13063 (diff) | |
download | scala-cba0cbb892e991a0946270d1a7da63993f248225.tar.gz scala-cba0cbb892e991a0946270d1a7da63993f248225.tar.bz2 scala-cba0cbb892e991a0946270d1a7da63993f248225.zip |
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.
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/run/reify_implicits-new.check | 1 | ||||
-rw-r--r-- | test/pending/run/reify_implicits-new.scala | 16 | ||||
-rw-r--r-- | test/pending/run/reify_implicits-old.check | 1 | ||||
-rw-r--r-- | test/pending/run/reify_implicits-old.scala | 15 |
4 files changed, 33 insertions, 0 deletions
diff --git a/test/pending/run/reify_implicits-new.check b/test/pending/run/reify_implicits-new.check new file mode 100644 index 0000000000..e3aeb20f6b --- /dev/null +++ b/test/pending/run/reify_implicits-new.check @@ -0,0 +1 @@ +x = List(1, 2, 3, 4) diff --git a/test/pending/run/reify_implicits-new.scala b/test/pending/run/reify_implicits-new.scala new file mode 100644 index 0000000000..42a1deef26 --- /dev/null +++ b/test/pending/run/reify_implicits-new.scala @@ -0,0 +1,16 @@ +import scala.reflect.{ClassTag, classTag} +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends App { + reify { + implicit def arrayWrapper[A : ClassTag](x: Array[A]) = + new { + def sort(p: (A, A) => Boolean) = { + util.Sorting.stableSort(x, p); x + } + } + val x = Array(2, 3, 1, 4) + println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) + }.eval +}
\ No newline at end of file diff --git a/test/pending/run/reify_implicits-old.check b/test/pending/run/reify_implicits-old.check new file mode 100644 index 0000000000..e3aeb20f6b --- /dev/null +++ b/test/pending/run/reify_implicits-old.check @@ -0,0 +1 @@ +x = List(1, 2, 3, 4) diff --git a/test/pending/run/reify_implicits-old.scala b/test/pending/run/reify_implicits-old.scala new file mode 100644 index 0000000000..8ff256d2d4 --- /dev/null +++ b/test/pending/run/reify_implicits-old.scala @@ -0,0 +1,15 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends App { + reify { + implicit def arrayWrapper[A : ClassManifest](x: Array[A]) = + new { + def sort(p: (A, A) => Boolean) = { + util.Sorting.stableSort(x, p); x + } + } + val x = Array(2, 3, 1, 4) + println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) + }.eval +}
\ No newline at end of file |