summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm/manifests-new.check58
-rw-r--r--test/files/jvm/manifests-new.scala (renamed from test/files/jvm/manifests.scala)21
-rw-r--r--test/files/jvm/manifests.check56
-rw-r--r--test/files/jvm/serialization-new.check (renamed from test/files/jvm/serialization.check)0
-rw-r--r--test/files/jvm/serialization-new.scala (renamed from test/files/jvm/serialization.scala)40
-rw-r--r--test/files/neg/t2386.check4
-rw-r--r--test/files/neg/t2386.scala3
-rw-r--r--test/files/neg/t3692-new.check4
-rw-r--r--test/files/neg/t3692-new.flags (renamed from test/files/neg/t3692.flags)0
-rw-r--r--test/files/neg/t3692-new.scala (renamed from test/files/neg/t3692.scala)8
-rw-r--r--test/files/neg/t3692.check11
-rw-r--r--test/files/neg/t5452-new.check8
-rw-r--r--test/files/neg/t5452-new.scala (renamed from test/files/neg/t5452.scala)4
-rw-r--r--test/files/neg/t5452.check8
-rw-r--r--test/files/pos/contextbounds-implicits-new.scala (renamed from test/files/pos/contextbounds-implicits.scala)2
-rw-r--r--test/files/pos/implicits-new.scala (renamed from test/files/pos/implicits.scala)36
-rw-r--r--test/files/pos/manifest1-new.scala (renamed from test/files/pos/manifest1.scala)8
-rw-r--r--test/files/pos/nothing_manifest_disambig-new.scala10
-rw-r--r--test/files/pos/nothing_manifest_disambig.scala10
-rw-r--r--test/files/pos/spec-constr-new.scala (renamed from test/files/pos/spec-constr.scala)2
-rw-r--r--test/files/pos/spec-doubledef-new.scala (renamed from test/files/pos/spec-doubledef.scala)2
-rw-r--r--test/files/pos/spec-fields-new.scala (renamed from test/files/pos/spec-fields.scala)2
-rw-r--r--test/files/pos/spec-params-new.scala (renamed from test/files/pos/spec-params.scala)8
-rw-r--r--test/files/pos/spec-sparsearray-new.scala (renamed from test/files/pos/spec-sparsearray.scala)2
-rw-r--r--test/files/pos/t1381-new.scala (renamed from test/files/pos/t1381.scala)2
-rw-r--r--test/files/pos/t2795-new.scala (renamed from test/files/pos/t2795.scala)2
-rw-r--r--[-rwxr-xr-x]test/files/pos/t3363-new.scala (renamed from test/files/pos/t3363.scala)14
-rw-r--r--test/files/pos/t3498-new.scala (renamed from test/files/pos/t3498.scala)2
-rw-r--r--test/files/presentation/ide-bug-1000531.check2
-rw-r--r--test/files/run/arrayclone-new.scala (renamed from test/files/run/arrayclone.scala)26
-rw-r--r--test/files/run/ctries-new/DumbHash.scala (renamed from test/files/run/ctries/DumbHash.scala)0
-rw-r--r--test/files/run/ctries-new/Wrap.scala (renamed from test/files/run/ctries/Wrap.scala)0
-rw-r--r--test/files/run/ctries-new/concmap.scala (renamed from test/files/run/ctries/concmap.scala)0
-rw-r--r--test/files/run/ctries-new/iterator.scala (renamed from test/files/run/ctries/iterator.scala)0
-rw-r--r--test/files/run/ctries-new/lnode.scala (renamed from test/files/run/ctries/lnode.scala)0
-rw-r--r--test/files/run/ctries-new/main.scala (renamed from test/files/run/ctries/main.scala)18
-rw-r--r--test/files/run/ctries-new/snapshot.scala (renamed from test/files/run/ctries/snapshot.scala)0
-rw-r--r--test/files/run/existentials3-new.check (renamed from test/files/run/existentials3.check)48
-rw-r--r--test/files/run/existentials3-new.scala (renamed from test/files/run/existentials3.scala)3
-rw-r--r--test/files/run/getClassTest-new.check (renamed from test/files/run/getClassTest.check)0
-rw-r--r--test/files/run/getClassTest-new.scala (renamed from test/files/run/getClassTest.scala)12
-rw-r--r--test/files/run/manifests-new.scala (renamed from test/files/run/manifests.scala)46
-rw-r--r--test/files/run/patmat_unapp_abstype-new.check (renamed from test/files/run/patmat_unapp_abstype.check)0
-rw-r--r--test/files/run/patmat_unapp_abstype-new.flags (renamed from test/files/run/patmat_unapp_abstype.flags)0
-rw-r--r--test/files/run/patmat_unapp_abstype-new.scala (renamed from test/files/run/patmat_unapp_abstype.scala)0
-rw-r--r--test/files/run/primitive-sigs-2-new.check (renamed from test/files/run/primitive-sigs-2.check)2
-rw-r--r--test/files/run/primitive-sigs-2-new.scala (renamed from test/files/run/primitive-sigs-2.scala)12
-rw-r--r--test/files/run/reflection-implClass-new.scala (renamed from test/files/run/reflection-implClass.scala)12
-rw-r--r--test/files/run/reify_implicits-new.check (renamed from test/files/run/reify_implicits.check)0
-rw-r--r--test/files/run/reify_implicits-new.scala (renamed from test/files/run/reify_implicits.scala)2
-rw-r--r--test/files/run/repl-power.check64
-rw-r--r--test/files/run/repl-power.scala3
-rw-r--r--test/files/run/t0421-new.check (renamed from test/files/run/t0421.check)0
-rw-r--r--test/files/run/t0421-new.scala (renamed from test/files/run/t0421.scala)12
-rw-r--r--test/files/run/t0677-new.scala (renamed from test/files/run/t0677.scala)2
-rw-r--r--test/files/run/t1195-new.check (renamed from test/files/run/t1195.check)0
-rw-r--r--test/files/run/t1195-new.scala (renamed from test/files/run/t1195.scala)2
-rw-r--r--[-rwxr-xr-x]test/files/run/t2236-new.scala (renamed from test/files/run/t2236.scala)2
-rw-r--r--test/files/run/t2386-new.check2
-rw-r--r--test/files/run/t2386-new.scala5
-rw-r--r--test/files/run/t3507-new.check (renamed from test/files/run/t3507.check)0
-rw-r--r--test/files/run/t3507-new.scala (renamed from test/files/run/t3507.scala)2
-rw-r--r--test/files/run/t3758.check6
-rw-r--r--test/files/run/t3758.scala10
-rw-r--r--test/files/run/t4110-new.check (renamed from test/files/run/t4110.check)0
-rw-r--r--test/files/run/t4110-new.scala (renamed from test/files/run/t4110.scala)4
-rw-r--r--test/files/scalacheck/array-new.scala (renamed from test/files/scalacheck/array.scala)9
-rw-r--r--test/files/specialized/spec-matrix-new.check (renamed from test/files/specialized/spec-matrix.check)0
-rw-r--r--test/files/specialized/spec-matrix-new.scala (renamed from test/files/specialized/spec-matrix.scala)16
69 files changed, 306 insertions, 343 deletions
diff --git a/test/files/jvm/manifests-new.check b/test/files/jvm/manifests-new.check
new file mode 100644
index 0000000000..9fca856970
--- /dev/null
+++ b/test/files/jvm/manifests-new.check
@@ -0,0 +1,58 @@
+x=(), t=ConcreteTypeTag[Unit], k=TypeRef, s=class Unit
+x=true, t=ConcreteTypeTag[Boolean], k=TypeRef, s=class Boolean
+x=a, t=ConcreteTypeTag[Char], k=TypeRef, s=class Char
+x=1, t=ConcreteTypeTag[Int], k=TypeRef, s=class Int
+x=abc, t=ConcreteTypeTag[String], k=TypeRef, s=class String
+x='abc, t=ConcreteTypeTag[Symbol], k=TypeRef, s=class Symbol
+
+x=List(()), t=ConcreteTypeTag[List[Unit]], k=TypeRef, s=class List
+x=List(true), t=ConcreteTypeTag[List[Boolean]], k=TypeRef, s=class List
+x=List(1), t=ConcreteTypeTag[List[Int]], k=TypeRef, s=class List
+x=List(abc), t=ConcreteTypeTag[List[String]], k=TypeRef, s=class List
+x=List('abc), t=ConcreteTypeTag[List[Symbol]], k=TypeRef, s=class List
+
+x=[Z, t=ConcreteTypeTag[Array[Boolean]], k=TypeRef, s=class Array
+x=[C, t=ConcreteTypeTag[Array[Char]], k=TypeRef, s=class Array
+x=[I, t=ConcreteTypeTag[Array[Int]], k=TypeRef, s=class Array
+x=[Ljava.lang.String;, t=ConcreteTypeTag[Array[String]], k=TypeRef, s=class Array
+x=[Lscala.Symbol;, t=ConcreteTypeTag[Array[Symbol]], k=TypeRef, s=class Array
+
+x=((),()), t=ConcreteTypeTag[(Unit, Unit)], k=TypeRef, s=class Tuple2
+x=(true,false), t=ConcreteTypeTag[(Boolean, Boolean)], k=TypeRef, s=class Tuple2
+x=(1,2), t=ConcreteTypeTag[(Int, Int)], k=TypeRef, s=class Tuple2
+x=(abc,xyz), t=ConcreteTypeTag[(String, String)], k=TypeRef, s=class Tuple2
+x=('abc,'xyz), t=ConcreteTypeTag[(Symbol, Symbol)], k=TypeRef, s=class Tuple2
+
+x=Test$, t=ConcreteTypeTag[Test.type], k=TypeRef, s=object Test
+x=scala.collection.immutable.List$, t=ConcreteTypeTag[scala.collection.immutable.List.type], k=TypeRef, s=object List
+
+x=Foo, t=ConcreteTypeTag[Foo[Int]], k=TypeRef, s=class Foo
+x=Foo, t=ConcreteTypeTag[Foo[List[Int]]], k=TypeRef, s=class Foo
+x=Foo, t=ConcreteTypeTag[Foo[Foo[Int]]], k=TypeRef, s=class Foo
+x=Foo, t=ConcreteTypeTag[Foo[List[Foo[Int]]]], k=TypeRef, s=class Foo
+
+x=Test1$$anon$1, t=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
+x=Test1$$anon$2, t=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
+
+()=()
+true=true
+a=a
+1=1
+'abc='abc
+
+List(())=List(())
+List(true)=List(true)
+List('abc)=List('abc)
+
+Array()=Array()
+Array(true)=Array(true)
+Array(a)=Array(a)
+Array(1)=Array(1)
+
+((),())=((),())
+(true,false)=(true,false)
+
+List(List(1), List(2))=List(List(1), List(2))
+
+Array(Array(1), Array(2))=Array(Array(1), Array(2))
+
diff --git a/test/files/jvm/manifests.scala b/test/files/jvm/manifests-new.scala
index 935427f5d4..d02f6ee608 100644
--- a/test/files/jvm/manifests.scala
+++ b/test/files/jvm/manifests-new.scala
@@ -37,11 +37,8 @@ object Test1 extends TestUtil {
print(('abc, 'xyz))
println()
- // Disabled: should these work? changing the inference for objects from
- // "object Test" to "Test.type" drags in a singleton manifest which for
- // some reason leads to serialization failure.
- // print(Test)
- // print(List)
+ print(Test)
+ print(List)
println()
print(new Foo(2))
@@ -69,8 +66,8 @@ object Test2 {
println("List('abc)="+load[List[Symbol]](dump(List('abc))))
println()
- def loadArray[T](x: Array[Byte])(implicit m: reflect.Manifest[Array[T]]) =
- load[Array[T]](x)(m).deep.toString
+ def loadArray[T](x: Array[Byte])(implicit t: reflect.ClassTag[Array[T]]) =
+ load[Array[T]](x)(t).deep.toString
println("Array()="+loadArray[Int](dump(Array(): Array[Int])))
println("Array(true)="+loadArray[Boolean](dump(Array(true))))
println("Array(a)="+loadArray[Char](dump(Array('a'))))
@@ -102,11 +99,11 @@ trait TestUtil {
in.readObject().asInstanceOf[A]
}
import scala.reflect._
- def print[T](x: T)(implicit m: Manifest[T]) {
- // manifests are no longer serializable
-// val m1: Manifest[T] = read(write(m))
- val m1: Manifest[T] = m
+ def print[T](x: T)(implicit t: ConcreteTypeTag[T]) {
+ // todo. type tags are not yet serializable
+// val t1: ConcreteTypeTag[T] = read(write(t))
+ val t1: ConcreteTypeTag[T] = t
val x1 = x.toString.replaceAll("@[0-9a-z]+$", "")
- println("x="+x1+", m="+m1+", k="+m1.tpe.kind+", s="+m1.sym.toString)
+ println("x="+x1+", t="+t1+", k="+t1.tpe.kind+", s="+t1.sym.toString)
}
}
diff --git a/test/files/jvm/manifests.check b/test/files/jvm/manifests.check
deleted file mode 100644
index be8ec2bb5b..0000000000
--- a/test/files/jvm/manifests.check
+++ /dev/null
@@ -1,56 +0,0 @@
-x=(), m=ConcreteTypeTag[Unit], k=TypeRef, s=class Unit
-x=true, m=ConcreteTypeTag[Boolean], k=TypeRef, s=class Boolean
-x=a, m=ConcreteTypeTag[Char], k=TypeRef, s=class Char
-x=1, m=ConcreteTypeTag[Int], k=TypeRef, s=class Int
-x=abc, m=ConcreteTypeTag[String], k=TypeRef, s=class String
-x='abc, m=ConcreteTypeTag[Symbol], k=TypeRef, s=class Symbol
-
-x=List(()), m=ConcreteTypeTag[List[Unit]], k=TypeRef, s=class List
-x=List(true), m=ConcreteTypeTag[List[Boolean]], k=TypeRef, s=class List
-x=List(1), m=ConcreteTypeTag[List[Int]], k=TypeRef, s=class List
-x=List(abc), m=ConcreteTypeTag[List[String]], k=TypeRef, s=class List
-x=List('abc), m=ConcreteTypeTag[List[Symbol]], k=TypeRef, s=class List
-
-x=[Z, m=ConcreteTypeTag[Array[Boolean]], k=TypeRef, s=class Array
-x=[C, m=ConcreteTypeTag[Array[Char]], k=TypeRef, s=class Array
-x=[I, m=ConcreteTypeTag[Array[Int]], k=TypeRef, s=class Array
-x=[Ljava.lang.String;, m=ConcreteTypeTag[Array[String]], k=TypeRef, s=class Array
-x=[Lscala.Symbol;, m=ConcreteTypeTag[Array[Symbol]], k=TypeRef, s=class Array
-
-x=((),()), m=ConcreteTypeTag[(Unit, Unit)], k=TypeRef, s=class Tuple2
-x=(true,false), m=ConcreteTypeTag[(Boolean, Boolean)], k=TypeRef, s=class Tuple2
-x=(1,2), m=ConcreteTypeTag[(Int, Int)], k=TypeRef, s=class Tuple2
-x=(abc,xyz), m=ConcreteTypeTag[(String, String)], k=TypeRef, s=class Tuple2
-x=('abc,'xyz), m=ConcreteTypeTag[(Symbol, Symbol)], k=TypeRef, s=class Tuple2
-
-
-x=Foo, m=ConcreteTypeTag[Foo[Int]], k=TypeRef, s=class Foo
-x=Foo, m=ConcreteTypeTag[Foo[List[Int]]], k=TypeRef, s=class Foo
-x=Foo, m=ConcreteTypeTag[Foo[Foo[Int]]], k=TypeRef, s=class Foo
-x=Foo, m=ConcreteTypeTag[Foo[List[Foo[Int]]]], k=TypeRef, s=class Foo
-
-x=Test1$$anon$1, m=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
-x=Test1$$anon$2, m=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
-
-()=()
-true=true
-a=a
-1=1
-'abc='abc
-
-List(())=List(())
-List(true)=List(true)
-List('abc)=List('abc)
-
-Array()=Array()
-Array(true)=Array(true)
-Array(a)=Array(a)
-Array(1)=Array(1)
-
-((),())=((),())
-(true,false)=(true,false)
-
-List(List(1), List(2))=List(List(1), List(2))
-
-Array(Array(1), Array(2))=Array(Array(1), Array(2))
-
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization-new.check
index fa51c6a879..fa51c6a879 100644
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization-new.check
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization-new.scala
index 9c2f2acdbf..bb971fdf36 100644
--- a/test/files/jvm/serialization.scala
+++ b/test/files/jvm/serialization-new.scala
@@ -282,7 +282,7 @@ object Test2_immutable {
// Test classes in package "scala.collection.mutable"
object Test3_mutable {
- import scala.reflect.ClassManifest
+ import scala.reflect.ArrayTag
import scala.collection.mutable.{
ArrayBuffer, ArrayBuilder, ArraySeq, ArrayStack, BitSet, DoubleLinkedList,
HashMap, HashSet, History, LinkedList, ListBuffer, Publisher, Queue,
@@ -296,21 +296,21 @@ object Test3_mutable {
ab1 ++= List("one", "two")
val _ab1: ArrayBuffer[String] = read(write(ab1))
check(ab1, _ab1)
-
+
// ArrayBuilder
val abu1 = ArrayBuilder.make[Long]
- val _abu1: ArrayBuilder[ClassManifest[Long]] = read(write(abu1))
+ val _abu1: ArrayBuilder[ArrayTag[Long]] = read(write(abu1))
check(abu1, _abu1)
val abu2 = ArrayBuilder.make[Float]
- val _abu2: ArrayBuilder[ClassManifest[Float]] = read(write(abu2))
+ val _abu2: ArrayBuilder[ArrayTag[Float]] = read(write(abu2))
check(abu2, _abu2)
-
+
// ArraySeq
val aq1 = ArraySeq(1, 2, 3)
val _aq1: ArraySeq[Int] = read(write(aq1))
check(aq1, _aq1)
-
+
// ArrayStack
val as1 = new ArrayStack[Int]
as1 ++= List(20, 2, 3).iterator
@@ -381,12 +381,12 @@ object Test3_mutable {
val wa1 = WrappedArray.make(Array(1, 2, 3))
val _wa1: WrappedArray[Int] = read(write(wa1))
check(wa1, _wa1)
-
+
// TreeSet
val ts1 = TreeSet[Int]() ++= Array(1, 2, 3)
val _ts1: TreeSet[Int] = read(write(ts1))
check(ts1, _ts1)
-
+
// concurrent.TrieMap
val ct1 = TrieMap[Int, String]() ++= Array(1 -> "one", 2 -> "two", 3 -> "three")
val _ct1: TrieMap[Int, String] = read(write(ct1))
@@ -548,7 +548,7 @@ class WithTransient extends Serializable {
@transient private lazy val a2 = 2
@transient object B extends Serializable
@transient private object C extends Serializable
-
+
def test = {
println(a1)
println(a2)
@@ -594,55 +594,55 @@ object Test {
// Test classes in package "scala.collection.parallel" and subpackages
object Test9_parallel {
import scala.collection.parallel._
-
+
try {
println()
-
+
// UnrolledBuffer
val ub = new collection.mutable.UnrolledBuffer[String]
ub ++= List("one", "two")
val _ub: collection.mutable.UnrolledBuffer[String] = read(write(ub))
check(ub, _ub)
-
+
// mutable.ParArray
val pa = mutable.ParArray("abc", "def", "etc")
val _pa: mutable.ParArray[String] = read(write(pa))
check(pa, _pa)
-
+
// mutable.ParHashMap
val mpm = mutable.ParHashMap(1 -> 2, 2 -> 4)
val _mpm: mutable.ParHashMap[Int, Int] = read(write(mpm))
check(mpm, _mpm)
-
+
// mutable.ParTrieMap
val mpc = mutable.ParTrieMap(1 -> 2, 2 -> 4)
val _mpc: mutable.ParTrieMap[Int, Int] = read(write(mpc))
check(mpc, _mpc)
-
+
// mutable.ParHashSet
val mps = mutable.ParHashSet(1, 2, 3)
val _mps: mutable.ParHashSet[Int] = read(write(mps))
check(mps, _mps)
-
+
// immutable.ParRange
val pr1 = immutable.ParRange(0, 4, 1, true)
val _pr1: immutable.ParRange = read(write(pr1))
check(pr1, _pr1)
-
+
val pr2 = immutable.ParRange(0, 4, 1, false)
val _pr2: immutable.ParRange = read(write(pr2))
check(pr2, _pr2)
-
+
// immutable.ParHashMap
val ipm = immutable.ParHashMap(5 -> 1, 10 -> 2)
val _ipm: immutable.ParHashMap[Int, Int] = read(write(ipm))
check(ipm, _ipm)
-
+
// immutable.ParHashSet
val ips = immutable.ParHashSet("one", "two")
val _ips: immutable.ParHashSet[String] = read(write(ips))
check(ips, _ips)
-
+
} catch {
case e: Exception =>
println("Error in Test5_parallel: " + e)
diff --git a/test/files/neg/t2386.check b/test/files/neg/t2386.check
deleted file mode 100644
index f70f12535f..0000000000
--- a/test/files/neg/t2386.check
+++ /dev/null
@@ -1,4 +0,0 @@
-t2386.scala:2: error: No ClassTag available for Array[_ >: String with Int]
- val a = Array(Array(1, 2), Array("a","b"))
- ^
-one error found
diff --git a/test/files/neg/t2386.scala b/test/files/neg/t2386.scala
deleted file mode 100644
index 56146cc5c3..0000000000
--- a/test/files/neg/t2386.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-object Test {
- val a = Array(Array(1, 2), Array("a","b"))
-}
diff --git a/test/files/neg/t3692-new.check b/test/files/neg/t3692-new.check
new file mode 100644
index 0000000000..e013daca74
--- /dev/null
+++ b/test/files/neg/t3692-new.check
@@ -0,0 +1,4 @@
+t3692-new.scala:15: error: unreachable code
+ case m2: Map[T, Int] => new java.util.HashMap[T, Integer]
+ ^
+one error found
diff --git a/test/files/neg/t3692.flags b/test/files/neg/t3692-new.flags
index 82becdfbfd..82becdfbfd 100644
--- a/test/files/neg/t3692.flags
+++ b/test/files/neg/t3692-new.flags
diff --git a/test/files/neg/t3692.scala b/test/files/neg/t3692-new.scala
index 151535ae94..46874b02e3 100644
--- a/test/files/neg/t3692.scala
+++ b/test/files/neg/t3692-new.scala
@@ -1,14 +1,14 @@
import java.lang.Integer
-object ManifestTester {
+object Tester {
def main(args: Array[String]) = {
val map = Map("John" -> 1, "Josh" -> 2)
- new ManifestTester().toJavaMap(map)
+ new Tester().toJavaMap(map)
}
}
-class ManifestTester {
- private final def toJavaMap[T, V](map: Map[T, V])(implicit m1: Manifest[T], m2: Manifest[V]): java.util.Map[_, _] = {
+class Tester {
+ private final def toJavaMap[T, V](map: Map[T, V])(implicit m1: ClassTag[T], m2: ClassTag[V]): java.util.Map[_, _] = {
map match {
case m0: Map[Int, Int] => new java.util.HashMap[Integer, Integer]
case m1: Map[Int, V] => new java.util.HashMap[Integer, V]
diff --git a/test/files/neg/t3692.check b/test/files/neg/t3692.check
deleted file mode 100644
index d83abd31e2..0000000000
--- a/test/files/neg/t3692.check
+++ /dev/null
@@ -1,11 +0,0 @@
-t3692.scala:11: warning: type Manifest in object Predef is deprecated: Use `@scala.reflect.ConcreteTypeTag` instead
- private final def toJavaMap[T, V](map: Map[T, V])(implicit m1: Manifest[T], m2: Manifest[V]): java.util.Map[_, _] = {
- ^
-t3692.scala:11: warning: type Manifest in object Predef is deprecated: Use `@scala.reflect.ConcreteTypeTag` instead
- private final def toJavaMap[T, V](map: Map[T, V])(implicit m1: Manifest[T], m2: Manifest[V]): java.util.Map[_, _] = {
- ^
-t3692.scala:15: error: unreachable code
- case m2: Map[T, Int] => new java.util.HashMap[T, Integer]
- ^
-two warnings found
-one error found
diff --git a/test/files/neg/t5452-new.check b/test/files/neg/t5452-new.check
new file mode 100644
index 0000000000..bbd3734f74
--- /dev/null
+++ b/test/files/neg/t5452-new.check
@@ -0,0 +1,8 @@
+t5452-new.scala:28: error: overloaded method value apply with alternatives:
+ ()Queryable[CoffeesTable] <and>
+ (t: Tree)(implicit evidence$2: ClassTag[CoffeesTable])Nothing <and>
+ (implicit evidence$1: ClassTag[CoffeesTable])Nothing
+ cannot be applied to (Queryable[CoffeesTable])
+ Queryable[CoffeesTable]( q.treeFilter(null) )
+ ^
+one error found
diff --git a/test/files/neg/t5452.scala b/test/files/neg/t5452-new.scala
index 1032db7a4b..c829de7d7c 100644
--- a/test/files/neg/t5452.scala
+++ b/test/files/neg/t5452-new.scala
@@ -15,8 +15,8 @@ case class Queryable[T]() {
}
object Queryable {
- def apply[T:Manifest] = ???
- def apply[T:Manifest]( t:Tree ) = ???
+ def apply[T:ClassTag] = ???
+ def apply[T:ClassTag]( t:Tree ) = ???
}
trait CoffeesTable{
diff --git a/test/files/neg/t5452.check b/test/files/neg/t5452.check
deleted file mode 100644
index 2f35a45509..0000000000
--- a/test/files/neg/t5452.check
+++ /dev/null
@@ -1,8 +0,0 @@
-t5452.scala:28: error: overloaded method value apply with alternatives:
- ()Queryable[CoffeesTable] <and>
- (t: Tree)(implicit evidence$2: Manifest[CoffeesTable])Nothing <and>
- (implicit evidence$1: Manifest[CoffeesTable])Nothing
- cannot be applied to (Queryable[CoffeesTable])
- Queryable[CoffeesTable]( q.treeFilter(null) )
- ^
-one error found
diff --git a/test/files/pos/contextbounds-implicits.scala b/test/files/pos/contextbounds-implicits-new.scala
index f9113ee320..71b3cca36f 100644
--- a/test/files/pos/contextbounds-implicits.scala
+++ b/test/files/pos/contextbounds-implicits-new.scala
@@ -3,6 +3,6 @@
*/
class C {
- def f[T: Manifest, S: Manifest](x: T, y: S)(implicit p: C) { }
+ def f[T: TypeTag, S: TypeTag](x: T, y: S)(implicit p: C) { }
}
diff --git a/test/files/pos/implicits.scala b/test/files/pos/implicits-new.scala
index 2c01dd0ba8..7eb7e100c3 100644
--- a/test/files/pos/implicits.scala
+++ b/test/files/pos/implicits-new.scala
@@ -45,7 +45,7 @@ object Test1625 {
implicit def byName[A](x: =>A) = new Wrapped(x)
implicit def byVal[A](x: A) = x
-
+
def main(args: Array[String]) = {
// val res:Wrapped = 7 // works
@@ -57,7 +57,7 @@ object Test1625 {
}
object Test2188 {
- implicit def toJavaList[A: ClassManifest](t:collection.Seq[A]):java.util.List[A] = java.util.Arrays.asList(t.toArray:_*)
+ implicit def toJavaList[A: ArrayTag](t:collection.Seq[A]):java.util.List[A] = java.util.Arrays.asList(t.toArray:_*)
val x: java.util.List[String] = List("foo")
}
@@ -67,23 +67,23 @@ object TestNumericWidening {
val x: java.lang.Long = y
}
-// #2709
-package foo2709 {
- class A
- class B
-
- package object bar {
- implicit def a2b(a: A): B = new B
- }
-
- package bar {
- object test {
- new A: B
- }
- }
-}
+// #2709
+package foo2709 {
+ class A
+ class B
+
+ package object bar {
+ implicit def a2b(a: A): B = new B
+ }
+
+ package bar {
+ object test {
+ new A: B
+ }
+ }
+}
// Problem with specs
object specsProblem {
- println(implicitly[Manifest[Class[_]]])
+ println(implicitly[ConcreteTypeTag[Class[_]]])
}
diff --git a/test/files/pos/manifest1.scala b/test/files/pos/manifest1-new.scala
index 8901aa7437..645bd42665 100644
--- a/test/files/pos/manifest1.scala
+++ b/test/files/pos/manifest1-new.scala
@@ -1,7 +1,7 @@
-import scala.reflect.Manifest
+import scala.reflect.TypeTag
object Test {
- def foo[T](x: T)(implicit m: Manifest[T]) {
+ def foo[T](x: T)(implicit m: TypeTag[T]) {
foo(List(x))
}
foo(1)
@@ -13,8 +13,8 @@ object Test {
abstract class C { type T = String; val x: T }
val c = new C { val x = "abc" }
foo(c.x)
- abstract class D { type T; implicit val m: Manifest[T]; val x: T }
- val stringm = implicitly[Manifest[String]]
+ abstract class D { type T; implicit val m: TypeTag[T]; val x: T }
+ val stringm = implicitly[TypeTag[String]]
val d: D = new D { type T = String; val m = stringm; val x = "x" }
import d.m
foo(d.x)
diff --git a/test/files/pos/nothing_manifest_disambig-new.scala b/test/files/pos/nothing_manifest_disambig-new.scala
new file mode 100644
index 0000000000..a60b0fdbf8
--- /dev/null
+++ b/test/files/pos/nothing_manifest_disambig-new.scala
@@ -0,0 +1,10 @@
+object Test {
+ def mani[T: TypeTag](xs: T) = xs
+ mani(List())
+
+ def listElMani[T: TypeTag](xs: List[T]) = xs
+ listElMani(List())
+
+ def foo[A, C](m : C)(implicit ev: C <:< Traversable[A], mani: TypeTag[A]): (C, A, TypeTag[A]) = (m, m.head, mani)
+ foo(List(1,2,3))
+} \ No newline at end of file
diff --git a/test/files/pos/nothing_manifest_disambig.scala b/test/files/pos/nothing_manifest_disambig.scala
deleted file mode 100644
index 076742033f..0000000000
--- a/test/files/pos/nothing_manifest_disambig.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-object Test {
- def mani[T: Manifest](xs: T) = xs
- mani(List())
-
- def listElMani[T: Manifest](xs: List[T]) = xs
- listElMani(List())
-
- def foo[A, C](m : C)(implicit ev: C <:< Traversable[A], mani: Manifest[A]): (C, A, Manifest[A]) = (m, m.head, mani)
- foo(List(1,2,3))
-} \ No newline at end of file
diff --git a/test/files/pos/spec-constr.scala b/test/files/pos/spec-constr-new.scala
index e908b65a41..7cd02b0680 100644
--- a/test/files/pos/spec-constr.scala
+++ b/test/files/pos/spec-constr-new.scala
@@ -1,4 +1,4 @@
-class SparseArray2[@specialized(Int) T:ClassManifest](val maxSize: Int, initialLength:Int = 3) {
+class SparseArray2[@specialized(Int) T:ArrayTag](val maxSize: Int, initialLength:Int = 3) {
private var data = new Array[T](initialLength);
private var index = new Array[Int](initialLength);
diff --git a/test/files/pos/spec-doubledef.scala b/test/files/pos/spec-doubledef-new.scala
index 86b0d857d3..33f1e82b6e 100644
--- a/test/files/pos/spec-doubledef.scala
+++ b/test/files/pos/spec-doubledef-new.scala
@@ -13,7 +13,7 @@ class C extends A[Int] {
override def getWith[@specialized(Int) Z](f: Int => Z) = f(value)
}
-abstract class B[T, @specialized(scala.Int) U : Manifest, @specialized(scala.Int) V <% Ordered[V]] {
+abstract class B[T, @specialized(scala.Int) U : TypeTag, @specialized(scala.Int) V <% Ordered[V]] {
val u: U
val v: V
diff --git a/test/files/pos/spec-fields.scala b/test/files/pos/spec-fields-new.scala
index 26a8c4ffbd..ddd8bd6624 100644
--- a/test/files/pos/spec-fields.scala
+++ b/test/files/pos/spec-fields-new.scala
@@ -1,4 +1,4 @@
-abstract class Foo[@specialized T: ClassManifest, U <: Ordered[U]](x: T, size: Int) {
+abstract class Foo[@specialized T: ArrayTag, U <: Ordered[U]](x: T, size: Int) {
var y: T
var z: T = x
diff --git a/test/files/pos/spec-params.scala b/test/files/pos/spec-params-new.scala
index f522512846..5fe0c82d40 100644
--- a/test/files/pos/spec-params.scala
+++ b/test/files/pos/spec-params-new.scala
@@ -1,4 +1,4 @@
-class Foo[@specialized A: ClassManifest] {
+class Foo[@specialized A: ArrayTag] {
// conflicting in bounds, expect a normalized member calling m
// and bridge + implementation in specialized subclasses
@@ -10,7 +10,7 @@ class Foo[@specialized A: ClassManifest] {
def m2[@specialized B <: String](x: B) = x.concat("a")
// conflicting in bounds, no mention of other spec members
- // expect an overload here plus implementation in
+ // expect an overload here plus implementation in
// compatible specialized subclasses
def m3[@specialized B >: A](x: B) = ()
@@ -19,10 +19,10 @@ class Foo[@specialized A: ClassManifest] {
// non-conflicting, expect a normalized overload implementation here
def m5[@specialized B](x: B) = x
-
+
// non-conflicting, expect a normalized implementation here
// and specialized implementations for all expansions in specialized subclasses
- def m6[@specialized B](x: B, y: A) =
+ def m6[@specialized B](x: B, y: A) =
goal(y)
def goal(x: A) = {
diff --git a/test/files/pos/spec-sparsearray.scala b/test/files/pos/spec-sparsearray-new.scala
index ea7710a785..0659bf7926 100644
--- a/test/files/pos/spec-sparsearray.scala
+++ b/test/files/pos/spec-sparsearray-new.scala
@@ -1,6 +1,6 @@
import scala.collection.mutable.MapLike
-class SparseArray[@specialized(Int) T:ClassManifest] extends collection.mutable.Map[Int,T] with collection.mutable.MapLike[Int,T,SparseArray[T]] {
+class SparseArray[@specialized(Int) T:ArrayTag] extends collection.mutable.Map[Int,T] with collection.mutable.MapLike[Int,T,SparseArray[T]] {
override def get(x: Int) = {
val ind = findOffset(x)
if(ind < 0) None else Some(error("ignore"))
diff --git a/test/files/pos/t1381.scala b/test/files/pos/t1381-new.scala
index 0762891898..8781ef4fdb 100644
--- a/test/files/pos/t1381.scala
+++ b/test/files/pos/t1381-new.scala
@@ -1,4 +1,4 @@
-import scala.reflect.Manifest
+import scala.reflect.TypeTag
class D[V <: Variable]
diff --git a/test/files/pos/t2795.scala b/test/files/pos/t2795-new.scala
index 935cb1f444..af9c4e8b1c 100644
--- a/test/files/pos/t2795.scala
+++ b/test/files/pos/t2795-new.scala
@@ -5,7 +5,7 @@ trait Element[T] {
trait Config {
type T <: Element[T]
- implicit val m: ClassManifest[T]
+ implicit val m: ArrayTag[T]
// XXX Following works fine:
// type T <: Element[_]
}
diff --git a/test/files/pos/t3363.scala b/test/files/pos/t3363-new.scala
index bae54084ea..270462745c 100755..100644
--- a/test/files/pos/t3363.scala
+++ b/test/files/pos/t3363-new.scala
@@ -7,12 +7,12 @@ object TestCase {
//if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine
implicit def map2ops[T,F](fs: Map[T,F]) = new MapOps[F] {
//if you remove this line, then code compiles
- lazy val m: Manifest[T] = error("just something to make it compile")
- def is(xs: List[T]) = List(xs)
- }
+ lazy val m: TypeTag[T] = error("just something to make it compile")
+ def is(xs: List[T]) = List(xs)
+ }
- def main(args: Array[String]) {
- println(Map(1 -> "2") is List(2))
- }
+ def main(args: Array[String]) {
+ println(Map(1 -> "2") is List(2))
+ }
- }
+ }
diff --git a/test/files/pos/t3498.scala b/test/files/pos/t3498-new.scala
index bcc90ca64c..653c50042a 100644
--- a/test/files/pos/t3498.scala
+++ b/test/files/pos/t3498-new.scala
@@ -1,4 +1,4 @@
-abstract class A[T, @specialized(scala.Int) U : Manifest] {
+abstract class A[T, @specialized(scala.Int) U : ArrayTag] {
def f(state: T): Array[U]
}
diff --git a/test/files/presentation/ide-bug-1000531.check b/test/files/presentation/ide-bug-1000531.check
index ae202001eb..2b48a80d38 100644
--- a/test/files/presentation/ide-bug-1000531.check
+++ b/test/files/presentation/ide-bug-1000531.check
@@ -99,7 +99,7 @@ retrieved 123 members
`method synchronized[T0](x$1: T0)T0`
`method take(n: Int)Iterator[B]`
`method takeWhile(p: B => Boolean)Iterator[B]`
-`method toArray[B >: B](implicit evidence$1: ClassManifest[B])Array[B]`
+`method toArray[B >: B](implicit evidence$1: ArrayTag[B])Array[B]`
`method toBuffer[B >: B]=> scala.collection.mutable.Buffer[B]`
`method toIndexedSeq=> scala.collection.immutable.IndexedSeq[B]`
`method toIterable=> Iterable[B]`
diff --git a/test/files/run/arrayclone.scala b/test/files/run/arrayclone-new.scala
index c9f7556b47..a4ba021409 100644
--- a/test/files/run/arrayclone.scala
+++ b/test/files/run/arrayclone-new.scala
@@ -16,7 +16,7 @@ object BooleanArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = false;
- assert(it(0) == true)
+ assert(it(0) == true)
}
object ByteArrayClone{
@@ -24,7 +24,7 @@ object ByteArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = 0;
- assert(it(0) == 1)
+ assert(it(0) == 1)
}
object ShortArrayClone{
@@ -32,7 +32,7 @@ object ShortArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = 0;
- assert(it(0) == 1)
+ assert(it(0) == 1)
}
object CharArrayClone{
@@ -40,7 +40,7 @@ object CharArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = 0;
- assert(it(0) == 1)
+ assert(it(0) == 1)
}
object IntArrayClone{
@@ -48,7 +48,7 @@ object IntArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = 0;
- assert(it(0) == 1)
+ assert(it(0) == 1)
}
object LongArrayClone{
@@ -56,7 +56,7 @@ object LongArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = 0;
- assert(it(0) == 1)
+ assert(it(0) == 1)
}
object FloatArrayClone{
@@ -64,7 +64,7 @@ object FloatArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = 0;
- assert(it(0) == 1)
+ assert(it(0) == 1)
}
object DoubleArrayClone{
@@ -72,7 +72,7 @@ object DoubleArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = 0;
- assert(it(0) == 1)
+ assert(it(0) == 1)
}
object ObjectArrayClone{
@@ -80,7 +80,7 @@ object ObjectArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = "0";
- assert(it(0) == "1")
+ assert(it(0) == "1")
}
object PolymorphicArrayClone{
@@ -88,14 +88,14 @@ object PolymorphicArrayClone{
val cloned = it.clone();
assert(cloned.sameElements(it));
cloned(0) = zero;
- assert(it(0) == one)
- }
+ assert(it(0) == one)
+ }
testIt(Array("one", "two"), "one", "two");
- class Mangler[T: Manifest](ts : T*){
+ class Mangler[T: ArrayTag](ts : T*){
// this will always be a BoxedAnyArray even after we've unboxed its contents.
- val it = ts.toArray[T];
+ val it = ts.toArray[T];
}
val mangled = new Mangler[Int](0, 1);
diff --git a/test/files/run/ctries/DumbHash.scala b/test/files/run/ctries-new/DumbHash.scala
index 8ef325b67c..8ef325b67c 100644
--- a/test/files/run/ctries/DumbHash.scala
+++ b/test/files/run/ctries-new/DumbHash.scala
diff --git a/test/files/run/ctries/Wrap.scala b/test/files/run/ctries-new/Wrap.scala
index 7b645c1612..7b645c1612 100644
--- a/test/files/run/ctries/Wrap.scala
+++ b/test/files/run/ctries-new/Wrap.scala
diff --git a/test/files/run/ctries/concmap.scala b/test/files/run/ctries-new/concmap.scala
index 3ec0256afb..3ec0256afb 100644
--- a/test/files/run/ctries/concmap.scala
+++ b/test/files/run/ctries-new/concmap.scala
diff --git a/test/files/run/ctries/iterator.scala b/test/files/run/ctries-new/iterator.scala
index b953a40e00..b953a40e00 100644
--- a/test/files/run/ctries/iterator.scala
+++ b/test/files/run/ctries-new/iterator.scala
diff --git a/test/files/run/ctries/lnode.scala b/test/files/run/ctries-new/lnode.scala
index 92a31088e5..92a31088e5 100644
--- a/test/files/run/ctries/lnode.scala
+++ b/test/files/run/ctries-new/lnode.scala
diff --git a/test/files/run/ctries/main.scala b/test/files/run/ctries-new/main.scala
index 8db7fcef54..1d40dab6c5 100644
--- a/test/files/run/ctries/main.scala
+++ b/test/files/run/ctries-new/main.scala
@@ -6,40 +6,40 @@
object Test {
-
+
def main(args: Array[String]) {
ConcurrentMapSpec.test()
IteratorSpec.test()
LNodeSpec.test()
SnapshotSpec.test()
}
-
+
}
trait Spec {
-
+
implicit def str2ops(s: String) = new {
def in[U](body: =>U) {
// just execute body
body
}
}
-
+
implicit def any2ops(a: Any) = new {
def shouldEqual(other: Any) = assert(a == other)
}
-
+
def evaluating[U](body: =>U) = new {
- def shouldProduce[T <: Throwable: ClassManifest]() = {
+ def shouldProduce[T <: Throwable: ClassTag]() = {
var produced = false
try body
catch {
- case e => if (e.getClass == implicitly[ClassManifest[T]].erasure) produced = true
+ case e => if (e.getClass == implicitly[ClassTag[T]].erasure) produced = true
} finally {
- assert(produced, "Did not produce exception of type: " + implicitly[ClassManifest[T]])
+ assert(produced, "Did not produce exception of type: " + implicitly[ClassTag[T]])
}
}
}
-
+
}
diff --git a/test/files/run/ctries/snapshot.scala b/test/files/run/ctries-new/snapshot.scala
index 5fe77d445b..5fe77d445b 100644
--- a/test/files/run/ctries/snapshot.scala
+++ b/test/files/run/ctries-new/snapshot.scala
diff --git a/test/files/run/existentials3.check b/test/files/run/existentials3-new.check
index e2c9382ab4..66674fbbd6 100644
--- a/test/files/run/existentials3.check
+++ b/test/files/run/existentials3-new.check
@@ -1,24 +1,24 @@
-ConcreteTypeTag[Bar.type], t=AbstractTypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
-ConcreteTypeTag[Bar], t=AbstractTypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
-ConcreteTypeTag[Test.ToS], t=RefinedType, s=f3
-ConcreteTypeTag[Test.ToS], t=RefinedType, s=f4
-ConcreteTypeTag[Test.ToS], t=RefinedType, s=f5
-ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
-ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
-ConcreteTypeTag[$anon], t=AbstractTypeRef, s= <: B with Test.ToS
-ConcreteTypeTag[$anon], t=AbstractTypeRef, s= <: B with A with Test.ToS
-TypeTag[List[Object{type T1}#T1]], t=TypeRef, s=class List
-ConcreteTypeTag[List[Seq[Int]]], t=TypeRef, s=class List
-ConcreteTypeTag[List[Seq[U forSome { type U <: Int }]]], t=TypeRef, s=class List
-ConcreteTypeTag[Bar.type], t=AbstractTypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
-ConcreteTypeTag[Bar], t=AbstractTypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
-ConcreteTypeTag[Test.ToS], t=RefinedType, s=g3
-ConcreteTypeTag[Test.ToS], t=RefinedType, s=g4
-ConcreteTypeTag[Test.ToS], t=RefinedType, s=g5
-ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
-ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
-ConcreteTypeTag[$anon], t=AbstractTypeRef, s= <: B with Test.ToS
-ConcreteTypeTag[$anon], t=AbstractTypeRef, s= <: B with A with Test.ToS
-TypeTag[List[Object{type T1}#T1]], t=TypeRef, s=class List
-ConcreteTypeTag[List[Seq[Int]]], t=TypeRef, s=class List
-ConcreteTypeTag[List[Seq[U forSome { type U <: Int }]]], t=TypeRef, s=class List
+ConcreteTypeTag[Bar.type], t=AbstractTypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
+ConcreteTypeTag[Bar], t=AbstractTypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f3
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f4
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f5
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[$anon], t=AbstractTypeRef, s= <: B with Test.ToS
+ConcreteTypeTag[$anon], t=AbstractTypeRef, s= <: B with A with Test.ToS
+TypeTag[List[Object{type T1}#T1]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[Int]]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[U forSome { type U <: Int }]]], t=TypeRef, s=class List
+ConcreteTypeTag[Bar.type], t=AbstractTypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
+ConcreteTypeTag[Bar], t=AbstractTypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g3
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g4
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g5
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[$anon], t=AbstractTypeRef, s= <: B with Test.ToS
+ConcreteTypeTag[$anon], t=AbstractTypeRef, s= <: B with A with Test.ToS
+TypeTag[List[Object{type T1}#T1]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[Int]]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[U forSome { type U <: Int }]]], t=TypeRef, s=class List
diff --git a/test/files/run/existentials3.scala b/test/files/run/existentials3-new.scala
index d6d5612687..32129a04c6 100644
--- a/test/files/run/existentials3.scala
+++ b/test/files/run/existentials3-new.scala
@@ -38,8 +38,7 @@ object Test {
def m[T: ConcreteTypeTag](x: T) = printTag(concreteTypeTag[T])
def m2[T: TypeTag](x: T) = printTag(typeTag[T])
- // manifests don't work for f10/g10
- // oh, they do now :)
+ // tags do work for f10/g10
def main(args: Array[String]): Unit = {
m(f1)
m(f2)
diff --git a/test/files/run/getClassTest.check b/test/files/run/getClassTest-new.check
index 94e86c3889..94e86c3889 100644
--- a/test/files/run/getClassTest.check
+++ b/test/files/run/getClassTest-new.check
diff --git a/test/files/run/getClassTest.scala b/test/files/run/getClassTest-new.scala
index 2485cd2c71..89778ca2d3 100644
--- a/test/files/run/getClassTest.scala
+++ b/test/files/run/getClassTest-new.scala
@@ -4,7 +4,7 @@ class AnyVals {
def f3 = 5.getClass
def f4 = (5: java.lang.Integer).getClass
def f5 = (5.asInstanceOf[AnyRef]).getClass
-
+
// scalap says:
//
// def f1 : java.lang.Class[?0] forSome {type ?0} = { /* compiled code */ }
@@ -19,18 +19,18 @@ class AnyVals {
// f2: java.lang.Class<?>
// f3: java.lang.Class<java.lang.Object>
// f4: java.lang.Class<? extends java.lang.Integer>
- // f5: java.lang.Class<?>
+ // f5: java.lang.Class<?>
}
class AnyRefs {
class A
class B extends A
-
+
def f1 = (new B: Any).getClass().newInstance()
def f2 = (new B: AnyRef).getClass().newInstance()
def f3 = (new B: A).getClass().newInstance()
def f4 = (new B: B).getClass().newInstance()
-
+
def f0[T >: B] = (new B: T).getClass().newInstance()
def f5 = f0[Any]
@@ -51,8 +51,8 @@ class MoreAnyRefs {
}
object Test {
- def returnTypes[T: Manifest] = (
- manifest[T].erasure.getMethods.toList
+ def returnTypes[T: ClassTag] = (
+ classTag[T].erasure.getMethods.toList
filter (_.getName startsWith "f")
sortBy (_.getName)
map (m => m.getName + ": " + m.getGenericReturnType.toString)
diff --git a/test/files/run/manifests.scala b/test/files/run/manifests-new.scala
index 2d64bf18a9..4485ce9124 100644
--- a/test/files/run/manifests.scala
+++ b/test/files/run/manifests-new.scala
@@ -11,7 +11,7 @@ object Test
import SubtypeRelationship.{ NONE, SAME, SUB, SUPER }
class VarianceTester[T, U, CC[_]](expected: Variances.Value)(
- implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) {
+ implicit ev1: TypeTag[T], ev2: TypeTag[U], ev3: TypeTag[CC[T]], ev4: TypeTag[CC[U]]) {
def elements = List(ev1.tpe <:< ev2.tpe, ev2.tpe <:< ev1.tpe)
def containers = List(ev3.tpe <:< ev4.tpe, ev4.tpe <:< ev3.tpe)
@@ -37,42 +37,40 @@ object Test
}
}
- def showsCovariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) =
+ def showsCovariance[T, U, CC[_]](implicit ev1: TypeTag[T], ev2: TypeTag[U], ev3: TypeTag[CC[T]], ev4: TypeTag[CC[U]]) =
new VarianceTester[T, U, CC](CO) showsExpectedVariance
- def showsInvariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) =
+ def showsInvariance[T, U, CC[_]](implicit ev1: TypeTag[T], ev2: TypeTag[U], ev3: TypeTag[CC[T]], ev4: TypeTag[CC[U]]) =
new VarianceTester[T, U, CC](IN) showsExpectedVariance
- def showsContravariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) =
+ def showsContravariance[T, U, CC[_]](implicit ev1: TypeTag[T], ev2: TypeTag[U], ev3: TypeTag[CC[T]], ev4: TypeTag[CC[U]]) =
new VarianceTester[T, U, CC](CONTRA) showsExpectedVariance
- def typeCompare[T, U](implicit ev1: Manifest[T], ev2: Manifest[U]) = {
- (ev1.tpe <:< ev2.tpe, ev2.tpe <:< ev1.tpe) match {
- case (true, true) => SAME
- case (true, false) => SUB
- case (false, true) => SUPER
- case (false, false) => NONE
- }
+ def typeCompare[T, U](implicit ev1: TypeTag[T], ev2: TypeTag[U]) = (ev1.tpe <:< ev2.tpe, ev2.tpe <:< ev1.tpe) match {
+ case (true, true) => SAME
+ case (true, false) => SUB
+ case (false, true) => SUPER
+ case (false, false) => NONE
}
- def assertAnyRef[T: Manifest] = List(
- manifest[T].tpe <:< manifest[Any].tpe,
- manifest[T].tpe <:< manifest[AnyRef].tpe,
- !(manifest[T].tpe <:< manifest[AnyVal].tpe)
+ def assertAnyRef[T: TypeTag] = List(
+ typeTag[T].tpe <:< typeTag[Any].tpe,
+ typeTag[T].tpe <:< typeTag[AnyRef].tpe,
+ !(typeTag[T].tpe <:< typeTag[AnyVal].tpe)
) foreach (assert(_, "assertAnyRef"))
- def assertAnyVal[T: Manifest] = List(
- manifest[T].tpe <:< manifest[Any].tpe,
- !(manifest[T].tpe <:< manifest[AnyRef].tpe),
- manifest[T].tpe <:< manifest[AnyVal].tpe
+ def assertAnyVal[T: TypeTag] = List(
+ typeTag[T].tpe <:< typeTag[Any].tpe,
+ !(typeTag[T].tpe <:< typeTag[AnyRef].tpe),
+ typeTag[T].tpe <:< typeTag[AnyVal].tpe
) foreach (assert(_, "assertAnyVal"))
- def assertSameType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SAME, "assertSameType")
- def assertSuperType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SUPER, "assertSuperType")
- def assertSubType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SUB, "assertSubType")
- def assertNoRelationship[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == NONE, "assertNoRelationship")
+ def assertSameType[T: TypeTag, U: TypeTag] = assert(typeCompare[T, U] == SAME, "assertSameType")
+ def assertSuperType[T: TypeTag, U: TypeTag] = assert(typeCompare[T, U] == SUPER, "assertSuperType")
+ def assertSubType[T: TypeTag, U: TypeTag] = assert(typeCompare[T, U] == SUB, "assertSubType")
+ def assertNoRelationship[T: TypeTag, U: TypeTag] = assert(typeCompare[T, U] == NONE, "assertNoRelationship")
- def testVariancesVia[T: Manifest, U: Manifest] = assert(
+ def testVariancesVia[T: TypeTag, U: TypeTag] = assert(
typeCompare[T, U] == SUB &&
showsCovariance[T, U, List] &&
showsInvariance[T, U, Set],
diff --git a/test/files/run/patmat_unapp_abstype.check b/test/files/run/patmat_unapp_abstype-new.check
index 72239d16cd..72239d16cd 100644
--- a/test/files/run/patmat_unapp_abstype.check
+++ b/test/files/run/patmat_unapp_abstype-new.check
diff --git a/test/files/run/patmat_unapp_abstype.flags b/test/files/run/patmat_unapp_abstype-new.flags
index ba80cad69b..ba80cad69b 100644
--- a/test/files/run/patmat_unapp_abstype.flags
+++ b/test/files/run/patmat_unapp_abstype-new.flags
diff --git a/test/files/run/patmat_unapp_abstype.scala b/test/files/run/patmat_unapp_abstype-new.scala
index 45496f08a2..45496f08a2 100644
--- a/test/files/run/patmat_unapp_abstype.scala
+++ b/test/files/run/patmat_unapp_abstype-new.scala
diff --git a/test/files/run/primitive-sigs-2.check b/test/files/run/primitive-sigs-2-new.check
index 1b6e24ed20..b82ddbeaff 100644
--- a/test/files/run/primitive-sigs-2.check
+++ b/test/files/run/primitive-sigs-2-new.check
@@ -1,7 +1,7 @@
T<java.lang.Object>
List(A, char, class java.lang.Object)
a
-public <T> java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.api.TypeTags.scala.reflect.api.TypeTags$ConcreteTypeTag<T>)
+public <T> java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.ArrayTag<T>)
public float[] Arr.arr3(float[][])
public scala.collection.immutable.List<java.lang.Character> Arr.arr2(java.lang.Character[])
public scala.collection.immutable.List<java.lang.Object> Arr.arr1(int[])
diff --git a/test/files/run/primitive-sigs-2.scala b/test/files/run/primitive-sigs-2-new.scala
index b7152f7e3d..7e13014cb2 100644
--- a/test/files/run/primitive-sigs-2.scala
+++ b/test/files/run/primitive-sigs-2-new.scala
@@ -10,22 +10,14 @@ class Arr {
def arr1(xs: Array[Int]): List[Int] = xs.toList
def arr2(xs: Array[jl.Character]): List[jl.Character] = xs.toList
def arr3(xss: Array[Array[Float]]): Array[Float] = xss map (_.sum)
- // This gets a signature like
- // public <T> java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.Manifest<T>)
- //
- // instead of the more appealing version from the past
- // public <T> T[] Arr.arr4(T[][],scala.reflect.Manifest<T>)
- //
- // because java inflict's its reference-only generic-arrays on us.
- //
- def arr4[T: Manifest](xss: Array[Array[T]]): Array[T] = xss map (_.head)
+ def arr4[T: ArrayTag](xss: Array[Array[T]]): Array[T] = xss map (_.head)
}
object Test {
val c1: Class[_] = classOf[T[_]]
val c2: Class[_] = classOf[C]
val c3: Class[_] = classOf[Arr]
-
+
val c1m = c1.getMethods.toList filter (_.getName == "f") map (_.getGenericReturnType.toString)
val c2m = c2.getMethods.toList filter (_.getName == "f") map (_.getGenericReturnType.toString)
val c3m = c3.getDeclaredMethods.toList map (_.toGenericString)
diff --git a/test/files/run/reflection-implClass.scala b/test/files/run/reflection-implClass-new.scala
index 7718b52f33..27374f2106 100644
--- a/test/files/run/reflection-implClass.scala
+++ b/test/files/run/reflection-implClass-new.scala
@@ -1,5 +1,5 @@
-/**
- * Tries to load a symbol for the `Foo$class` using Scala reflection.
+/**
+ * Tries to load a symbol for the `Foo$class` using Scala reflection.
* Since trait implementation classes do not get pickling information
* symbol for them should be created using fallback mechanism
* that exposes Java reflection information dressed up in
@@ -8,15 +8,15 @@
object Test extends App with Outer {
import scala.reflect.mirror
- assert(mirror.classToSymbol(manifest[Foo].erasure).typeSignature.declaration(mirror.newTermName("bar")).typeSignature ==
- mirror.classToSymbol(manifest[Bar].erasure).typeSignature.declaration(mirror.newTermName("foo")).typeSignature)
+ assert(mirror.classToSymbol(classTag[Foo].erasure).typeSignature.declaration(mirror.newTermName("bar")).typeSignature ==
+ mirror.classToSymbol(classTag[Bar].erasure).typeSignature.declaration(mirror.newTermName("foo")).typeSignature)
- val s1 = implClass(manifest[Foo].erasure)
+ val s1 = implClass(classTag[Foo].erasure)
assert(s1 != mirror.NoSymbol)
assert(s1.typeSignature != mirror.NoType)
assert(s1.companionSymbol.typeSignature != mirror.NoType)
assert(s1.companionSymbol.typeSignature.declaration(mirror.newTermName("bar")) != mirror.NoSymbol)
- val s2 = implClass(manifest[Bar].erasure)
+ val s2 = implClass(classTag[Bar].erasure)
assert(s2 != mirror.NoSymbol)
assert(s2.typeSignature != mirror.NoType)
assert(s2.companionSymbol.typeSignature != mirror.NoType)
diff --git a/test/files/run/reify_implicits.check b/test/files/run/reify_implicits-new.check
index e3aeb20f6b..e3aeb20f6b 100644
--- a/test/files/run/reify_implicits.check
+++ b/test/files/run/reify_implicits-new.check
diff --git a/test/files/run/reify_implicits.scala b/test/files/run/reify_implicits-new.scala
index 60971c3cfb..69198391d1 100644
--- a/test/files/run/reify_implicits.scala
+++ b/test/files/run/reify_implicits-new.scala
@@ -2,7 +2,7 @@ import scala.reflect.mirror._
object Test extends App {
reify {
- implicit def arrayWrapper[A : ClassManifest](x: Array[A]) =
+ implicit def arrayWrapper[A : ArrayTag](x: Array[A]) =
new {
def sort(p: (A, A) => Boolean) = {
util.Sorting.stableSort(x, p); x
diff --git a/test/files/run/repl-power.check b/test/files/run/repl-power.check
index 1e7b6f0cd8..c509434116 100644
--- a/test/files/run/repl-power.check
+++ b/test/files/run/repl-power.check
@@ -1,32 +1,32 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
-
-scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
-
-scala> // guarding against "error: reference to global is ambiguous"
-
-scala> global.emptyValDef // "it is imported twice in the same scope by ..."
-res0: $r.global.emptyValDef.type = private val _ = _
-
-scala> val tp = ArrayClass[scala.util.Random] // magic with manifests
-tp: $r.global.Type = Array[scala.util.Random]
-
-scala> tp.memberType(Array_apply) // evidence
-res1: $r.global.Type = (i: Int)scala.util.Random
-
-scala> val m = LIT(10) MATCH (CASE(LIT(5)) ==> FALSE, DEFAULT ==> TRUE) // treedsl
-m: $r.treedsl.global.Match =
-10 match {
- case 5 => false
- case _ => true
-}
-
-scala> typed(m).tpe // typed is in scope
-res2: $r.treedsl.global.Type = Boolean
-
-scala>
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala> :power
+** Power User mode enabled - BEEP WHIR GYVE **
+** :phase has been set to 'typer'. **
+** scala.tools.nsc._ has been imported **
+** global._, definitions._ also imported **
+** Try :help, :vals, power.<tab> **
+
+scala> // guarding against "error: reference to global is ambiguous"
+
+scala> global.emptyValDef // "it is imported twice in the same scope by ..."
+res0: $r.global.emptyValDef.type = private val _ = _
+
+scala> val tp = ArrayClass[scala.util.Random] // magic with tags
+tp: $r.global.Type = Array[scala.util.Random]
+
+scala> tp.memberType(Array_apply) // evidence
+res1: $r.global.Type = (i: Int)scala.util.Random
+
+scala> val m = LIT(10) MATCH (CASE(LIT(5)) ==> FALSE, DEFAULT ==> TRUE) // treedsl
+m: $r.treedsl.global.Match =
+10 match {
+ case 5 => false
+ case _ => true
+}
+
+scala> typed(m).tpe // typed is in scope
+res2: $r.treedsl.global.Type = Boolean
+
+scala>
diff --git a/test/files/run/repl-power.scala b/test/files/run/repl-power.scala
index 27da3df106..f7c88c63ff 100644
--- a/test/files/run/repl-power.scala
+++ b/test/files/run/repl-power.scala
@@ -5,10 +5,9 @@ object Test extends ReplTest {
:power
// guarding against "error: reference to global is ambiguous"
global.emptyValDef // "it is imported twice in the same scope by ..."
-val tp = ArrayClass[scala.util.Random] // magic with manifests
+val tp = ArrayClass[scala.util.Random] // magic with tags
tp.memberType(Array_apply) // evidence
val m = LIT(10) MATCH (CASE(LIT(5)) ==> FALSE, DEFAULT ==> TRUE) // treedsl
typed(m).tpe // typed is in scope
""".trim
}
-
diff --git a/test/files/run/t0421.check b/test/files/run/t0421-new.check
index cdcf042f19..cdcf042f19 100644
--- a/test/files/run/t0421.check
+++ b/test/files/run/t0421-new.check
diff --git a/test/files/run/t0421.scala b/test/files/run/t0421-new.scala
index 8d51013924..7de6b7f2c4 100644
--- a/test/files/run/t0421.scala
+++ b/test/files/run/t0421-new.scala
@@ -1,23 +1,23 @@
// ticket #421
object Test extends App {
- def transpose[A: ClassManifest](xss: Array[Array[A]]) = {
+ def transpose[A: ArrayTag](xss: Array[Array[A]]) = {
for (i <- Array.range(0, xss(0).length)) yield
for (xs <- xss) yield xs(i)
}
def scalprod(xs: Array[Double], ys: Array[Double]) = {
- var acc = 0.0
- for ((x, y) <- xs zip ys) acc = acc + x * y
+ var acc = 0.0
+ for ((x, y) <- xs zip ys) acc = acc + x * y
acc
}
def matmul(xss: Array[Array[Double]], yss: Array[Array[Double]]) = {
- val ysst = transpose(yss)
+ val ysst = transpose(yss)
val ysst1: Array[Array[Double]] = yss.transpose
assert(ysst.deep == ysst1.deep)
for (xs <- xss) yield
- for (yst <- ysst) yield
+ for (yst <- ysst) yield
scalprod(xs, yst)
}
@@ -25,6 +25,6 @@ object Test extends App {
println(transpose(a1).deep.mkString("[", ",", "]"))
println(matmul(Array(Array(2, 3)), Array(Array(5), Array(7))).deep.mkString("[", ",", "]"))
-
+
println(matmul(Array(Array(4)), Array(Array(6, 8))).deep.mkString("[", ",", "]"))
}
diff --git a/test/files/run/t0677.scala b/test/files/run/t0677-new.scala
index 6c8a3a7e99..bf7a3971dc 100644
--- a/test/files/run/t0677.scala
+++ b/test/files/run/t0677-new.scala
@@ -1,5 +1,5 @@
object Test extends App {
- class X[T: ClassManifest] {
+ class X[T: ArrayTag] {
val a = Array.ofDim[T](3, 4)
}
val x = new X[String]
diff --git a/test/files/run/t1195.check b/test/files/run/t1195-new.check
index 554e3fd03d..554e3fd03d 100644
--- a/test/files/run/t1195.check
+++ b/test/files/run/t1195-new.check
diff --git a/test/files/run/t1195.scala b/test/files/run/t1195-new.scala
index 93b1dcbd07..6f28a4a167 100644
--- a/test/files/run/t1195.scala
+++ b/test/files/run/t1195-new.scala
@@ -7,7 +7,7 @@ object Test {
val g1 = g()
val h1 = h()
- def m[T: Manifest](x: T) = println(manifest[T] + ", underlying = " + manifest[T].sym.typeSignature)
+ def m[T: TypeTag](x: T) = println(typeTag[T] + ", underlying = " + typeTag[T].sym.typeSignature)
def main(args: Array[String]): Unit = {
m(f)
diff --git a/test/files/run/t2236.scala b/test/files/run/t2236-new.scala
index 64ed18c805..bbabe8e7d9 100755..100644
--- a/test/files/run/t2236.scala
+++ b/test/files/run/t2236-new.scala
@@ -1,4 +1,4 @@
-class T[A](implicit val m:Manifest[A])
+class T[A](implicit val m:TypeTag[A])
class Foo
class Bar extends T[Foo]
object Test extends App {
diff --git a/test/files/run/t2386-new.check b/test/files/run/t2386-new.check
new file mode 100644
index 0000000000..98e226f946
--- /dev/null
+++ b/test/files/run/t2386-new.check
@@ -0,0 +1,2 @@
+a(0) = Array(1, 2)
+a(1) = Array("a", "b")
diff --git a/test/files/run/t2386-new.scala b/test/files/run/t2386-new.scala
new file mode 100644
index 0000000000..15d1859759
--- /dev/null
+++ b/test/files/run/t2386-new.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ val a = Array(Array(1, 2), Array("a","b"))
+ println("a(0) = Array(" + (a(0) mkString ", ") + ")")
+ println("a(1) = Array(" + (a(1) map (s => "\"" + s + "\"") mkString ", ") + ")")
+}
diff --git a/test/files/run/t3507.check b/test/files/run/t3507-new.check
index 6e4fa4170e..6e4fa4170e 100644
--- a/test/files/run/t3507.check
+++ b/test/files/run/t3507-new.check
diff --git a/test/files/run/t3507.scala b/test/files/run/t3507-new.scala
index 3cdd40a881..c7a529e8b8 100644
--- a/test/files/run/t3507.scala
+++ b/test/files/run/t3507-new.scala
@@ -9,7 +9,7 @@ object Test extends App {
var a: A = new A // mutable
val c /*: object _1.b.c forSome { val _1: A } */ = a.m // widening using existential
- def mani[T: Manifest](x: T) = println(manifest[T])
+ def mani[T: TypeTag](x: T) = println(typeTag[T])
mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier
// --> _1 is not in scope here
} \ No newline at end of file
diff --git a/test/files/run/t3758.check b/test/files/run/t3758.check
deleted file mode 100644
index 9c6ab655a3..0000000000
--- a/test/files/run/t3758.check
+++ /dev/null
@@ -1,6 +0,0 @@
-List(String)
-List(Int)
-List(Float)
-List(String)
-List(Int)
-List(Float)
diff --git a/test/files/run/t3758.scala b/test/files/run/t3758.scala
deleted file mode 100644
index 10bfb5724b..0000000000
--- a/test/files/run/t3758.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-object Test {
- def main(args: Array[String]): Unit = {
- println(classManifest[Array[String]].tpe.typeArguments)
- println(classManifest[Array[Int]].tpe.typeArguments)
- println(classManifest[Array[Float]].tpe.typeArguments)
- println(manifest[Array[String]].tpe.typeArguments)
- println(manifest[Array[Int]].tpe.typeArguments)
- println(manifest[Array[Float]].tpe.typeArguments)
- }
-}
diff --git a/test/files/run/t4110.check b/test/files/run/t4110-new.check
index 28f220e1fe..28f220e1fe 100644
--- a/test/files/run/t4110.check
+++ b/test/files/run/t4110-new.check
diff --git a/test/files/run/t4110.scala b/test/files/run/t4110-new.scala
index 4bd377b73e..3285b82c61 100644
--- a/test/files/run/t4110.scala
+++ b/test/files/run/t4110-new.scala
@@ -1,9 +1,9 @@
object Test extends App {
- def inferredType[T : Manifest](v : T) = println(manifest[T])
+ def inferredType[T : TypeTag](v : T) = println(typeTag[T])
trait A
trait B
-
+
inferredType(new A with B)
val name = new A with B
diff --git a/test/files/scalacheck/array.scala b/test/files/scalacheck/array-new.scala
index f262bc6320..18d577ca6d 100644
--- a/test/files/scalacheck/array.scala
+++ b/test/files/scalacheck/array-new.scala
@@ -9,9 +9,9 @@ import scala.collection.mutable.ArraySeq
object Test extends Properties("Array") {
/** At this moment the authentic scalacheck Array Builder/Arb bits are commented out.
*/
- implicit def arbArray[T](implicit a: Arbitrary[T], m: Manifest[T]): Arbitrary[Array[T]] =
+ implicit def arbArray[T](implicit a: Arbitrary[T], m: ArrayTag[T]): Arbitrary[Array[T]] =
Arbitrary(containerOf[List,T](arbitrary[T]) map (_.toArray))
-
+
val arrGen: Gen[Array[_]] = oneOf(
arbitrary[Array[Int]],
arbitrary[Array[Array[Int]]],
@@ -20,7 +20,7 @@ object Test extends Properties("Array") {
arbitrary[Array[Boolean]],
arbitrary[Array[AnyVal]]
)
-
+
// inspired by #1857 and #2352
property("eq/ne") = forAll(arrGen, arrGen) { (c1, c2) =>
(c1 eq c2) || (c1 ne c2)
@@ -32,6 +32,5 @@ object Test extends Properties("Array") {
val arr = Array.ofDim[String](i1, i2, i3)
val flattened = arr flatMap (x => x) flatMap (x => x)
flattened.length == i1 * i2 * i3
- }
+ }
}
-
diff --git a/test/files/specialized/spec-matrix.check b/test/files/specialized/spec-matrix-new.check
index 5ec3e84597..5ec3e84597 100644
--- a/test/files/specialized/spec-matrix.check
+++ b/test/files/specialized/spec-matrix-new.check
diff --git a/test/files/specialized/spec-matrix.scala b/test/files/specialized/spec-matrix-new.scala
index 98735c8c03..65b46e8d48 100644
--- a/test/files/specialized/spec-matrix.scala
+++ b/test/files/specialized/spec-matrix-new.scala
@@ -1,9 +1,9 @@
/** Test matrix multiplication with specialization.
*/
-class Matrix[@specialized A: ClassManifest](val rows: Int, val cols: Int) {
+class Matrix[@specialized A: ArrayTag](val rows: Int, val cols: Int) {
private val arr: Array[Array[A]] = Array.ofDim[A](rows, cols)
-
+
def apply(i: Int, j: Int): A = {
if (i < 0 || i >= rows || j < 0 || j >= cols)
throw new NoSuchElementException("Indexes out of bounds: " + (i, j))
@@ -29,7 +29,7 @@ object Test {
def main(args: Array[String]) {
val m = randomMatrix(200, 100)
val n = randomMatrix(100, 200)
-
+
val p = mult(m, n)
println(p(0, 0))
println("Boxed doubles: " + runtime.BoxesRunTime.doubleBoxCount)
@@ -38,7 +38,7 @@ object Test {
def randomMatrix(n: Int, m: Int) = {
val r = new util.Random(10)
- val x = new Matrix[Double](n, m)
+ val x = new Matrix[Double](n, m)
for (i <- 0 until n; j <- 0 until m)
x(i, j) = (r.nextInt % 1000).toDouble
x
@@ -46,17 +46,17 @@ object Test {
def printMatrix[Double](m: Matrix[Double]) {
for (i <- 0 until m.rows) {
- for (j <- 0 until m.cols)
+ for (j <- 0 until m.cols)
print("%5.3f ".format(m(i, j)))
println
}
}
- def multManifest[@specialized(Int) T](m: Matrix[T], n: Matrix[T])(implicit cm: ClassManifest[T], num: Numeric[T]) {
+ def multTag[@specialized(Int) T](m: Matrix[T], n: Matrix[T])(implicit at: ArrayTag[T], num: Numeric[T]) {
val p = new Matrix[T](m.rows, n.cols)
import num._
- for (i <- 0 until m.rows)
+ for (i <- 0 until m.rows)
for (j <- 0 until n.cols) {
var sum = num.zero
for (k <- 0 until n.rows)
@@ -68,7 +68,7 @@ object Test {
def mult(m: Matrix[Double], n: Matrix[Double]) = {
val p = new Matrix[Double](m.rows, n.cols)
- for (i <- 0 until m.rows)
+ for (i <- 0 until m.rows)
for (j <- 0 until n.cols) {
var sum = 0.0
for (k <- 0 until n.rows)