diff options
Diffstat (limited to 'test/files/run')
-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.check | 64 | ||||
-rw-r--r-- | test/files/run/repl-power.scala | 3 | ||||
-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.check | 2 | ||||
-rw-r--r-- | test/files/run/t2386-new.scala | 5 | ||||
-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.check | 6 | ||||
-rw-r--r-- | test/files/run/t3758.scala | 10 | ||||
-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 |
37 files changed, 137 insertions, 158 deletions
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 |