diff options
Diffstat (limited to 'test/files/run')
48 files changed, 154 insertions, 128 deletions
diff --git a/test/files/run/abstypetags_core.scala b/test/files/run/abstypetags_core.scala index 226de94055..2692fec035 100644 --- a/test/files/run/abstypetags_core.scala +++ b/test/files/run/abstypetags_core.scala @@ -1,34 +1,34 @@ import scala.reflect.runtime.universe._ object Test extends App { - println(implicitly[AbsTypeTag[Byte]] eq AbsTypeTag.Byte) - println(implicitly[AbsTypeTag[Byte]]) - println(implicitly[AbsTypeTag[Short]] eq AbsTypeTag.Short) - println(implicitly[AbsTypeTag[Short]]) - println(implicitly[AbsTypeTag[Char]] eq AbsTypeTag.Char) - println(implicitly[AbsTypeTag[Char]]) - println(implicitly[AbsTypeTag[Int]] eq AbsTypeTag.Int) - println(implicitly[AbsTypeTag[Int]]) - println(implicitly[AbsTypeTag[Long]] eq AbsTypeTag.Long) - println(implicitly[AbsTypeTag[Long]]) - println(implicitly[AbsTypeTag[Float]] eq AbsTypeTag.Float) - println(implicitly[AbsTypeTag[Float]]) - println(implicitly[AbsTypeTag[Double]] eq AbsTypeTag.Double) - println(implicitly[AbsTypeTag[Double]]) - println(implicitly[AbsTypeTag[Boolean]] eq AbsTypeTag.Boolean) - println(implicitly[AbsTypeTag[Boolean]]) - println(implicitly[AbsTypeTag[Unit]] eq AbsTypeTag.Unit) - println(implicitly[AbsTypeTag[Unit]]) - println(implicitly[AbsTypeTag[Any]] eq AbsTypeTag.Any) - println(implicitly[AbsTypeTag[Any]]) - println(implicitly[AbsTypeTag[AnyVal]] eq AbsTypeTag.AnyVal) - println(implicitly[AbsTypeTag[AnyVal]]) - println(implicitly[AbsTypeTag[AnyRef]] eq AbsTypeTag.AnyRef) - println(implicitly[AbsTypeTag[AnyRef]]) - println(implicitly[AbsTypeTag[Object]] eq AbsTypeTag.Object) - println(implicitly[AbsTypeTag[Object]]) - println(implicitly[AbsTypeTag[Null]] eq AbsTypeTag.Null) - println(implicitly[AbsTypeTag[Null]]) - println(implicitly[AbsTypeTag[Nothing]] eq AbsTypeTag.Nothing) - println(implicitly[AbsTypeTag[Nothing]]) + println(implicitly[WeakTypeTag[Byte]] eq WeakTypeTag.Byte) + println(implicitly[WeakTypeTag[Byte]]) + println(implicitly[WeakTypeTag[Short]] eq WeakTypeTag.Short) + println(implicitly[WeakTypeTag[Short]]) + println(implicitly[WeakTypeTag[Char]] eq WeakTypeTag.Char) + println(implicitly[WeakTypeTag[Char]]) + println(implicitly[WeakTypeTag[Int]] eq WeakTypeTag.Int) + println(implicitly[WeakTypeTag[Int]]) + println(implicitly[WeakTypeTag[Long]] eq WeakTypeTag.Long) + println(implicitly[WeakTypeTag[Long]]) + println(implicitly[WeakTypeTag[Float]] eq WeakTypeTag.Float) + println(implicitly[WeakTypeTag[Float]]) + println(implicitly[WeakTypeTag[Double]] eq WeakTypeTag.Double) + println(implicitly[WeakTypeTag[Double]]) + println(implicitly[WeakTypeTag[Boolean]] eq WeakTypeTag.Boolean) + println(implicitly[WeakTypeTag[Boolean]]) + println(implicitly[WeakTypeTag[Unit]] eq WeakTypeTag.Unit) + println(implicitly[WeakTypeTag[Unit]]) + println(implicitly[WeakTypeTag[Any]] eq WeakTypeTag.Any) + println(implicitly[WeakTypeTag[Any]]) + println(implicitly[WeakTypeTag[AnyVal]] eq WeakTypeTag.AnyVal) + println(implicitly[WeakTypeTag[AnyVal]]) + println(implicitly[WeakTypeTag[AnyRef]] eq WeakTypeTag.AnyRef) + println(implicitly[WeakTypeTag[AnyRef]]) + println(implicitly[WeakTypeTag[Object]] eq WeakTypeTag.Object) + println(implicitly[WeakTypeTag[Object]]) + println(implicitly[WeakTypeTag[Null]] eq WeakTypeTag.Null) + println(implicitly[WeakTypeTag[Null]]) + println(implicitly[WeakTypeTag[Nothing]] eq WeakTypeTag.Nothing) + println(implicitly[WeakTypeTag[Nothing]]) }
\ No newline at end of file diff --git a/test/files/run/abstypetags_serialize.scala b/test/files/run/abstypetags_serialize.scala index 5b9142f6d5..38a7aba325 100644 --- a/test/files/run/abstypetags_serialize.scala +++ b/test/files/run/abstypetags_serialize.scala @@ -3,7 +3,7 @@ import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} object Test extends App { - def test(tag: AbsTypeTag[_]) = + def test(tag: WeakTypeTag[_]) = try { val fout = new ByteArrayOutputStream() val out = new ObjectOutputStream(fout) @@ -13,7 +13,7 @@ object Test extends App { val fin = new ByteArrayInputStream(fout.toByteArray) val in = new ObjectInputStream(fin) - val retag = in.readObject().asInstanceOf[scala.reflect.basis.AbsTypeTag[_]].in(cm) + val retag = in.readObject().asInstanceOf[scala.reflect.basis.WeakTypeTag[_]].in(cm) in.close() fin.close() @@ -24,8 +24,8 @@ object Test extends App { } def qwe[T, U[_]] = { - test(implicitly[AbsTypeTag[T]]) - test(implicitly[AbsTypeTag[U[String]]]) + test(implicitly[WeakTypeTag[T]]) + test(implicitly[WeakTypeTag[U[String]]]) } qwe diff --git a/test/files/run/existentials3-new.check b/test/files/run/existentials3-new.check index a036d92a24..2550f4dae0 100644 --- a/test/files/run/existentials3-new.check +++ b/test/files/run/existentials3-new.check @@ -1,24 +1,24 @@ -Bar.type, t=TypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
-Bar, t=TypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
+Bar.type, t=TypeRef, s=type Bar.type
+Bar, t=TypeRef, s=type Bar
Test.ToS, t=RefinedType, s=f3
Test.ToS, t=RefinedType, s=f4
Test.ToS, t=RefinedType, s=f5
() => Test.ToS, t=TypeRef, s=class Function0
() => Test.ToS, t=TypeRef, s=class Function0
-$anon, t=TypeRef, s= <: B with Test.ToS
-$anon, t=TypeRef, s= <: B with A with Test.ToS
+$anon, t=TypeRef, s=type $anon
+$anon, t=TypeRef, s=type $anon
List[java.lang.Object{type T1}#T1], t=TypeRef, s=class List
List[Seq[Int]], t=TypeRef, s=class List
List[Seq[U forSome { type U <: Int }]], t=TypeRef, s=class List
-Bar.type, t=TypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
-Bar, t=TypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
+Bar.type, t=TypeRef, s=type Bar.type
+Bar, t=TypeRef, s=type Bar
Test.ToS, t=RefinedType, s=g3
Test.ToS, t=RefinedType, s=g4
Test.ToS, t=RefinedType, s=g5
() => Test.ToS, t=TypeRef, s=class Function0
() => Test.ToS, t=TypeRef, s=class Function0
-$anon, t=TypeRef, s= <: B with Test.ToS
-$anon, t=TypeRef, s= <: B with A with Test.ToS
+$anon, t=TypeRef, s=type $anon
+$anon, t=TypeRef, s=type $anon
List[java.lang.Object{type T1}#T1], t=TypeRef, s=class List
List[Seq[Int]], t=TypeRef, s=class List
List[Seq[U forSome { type U <: Int }]], t=TypeRef, s=class List
diff --git a/test/files/run/existentials3-new.scala b/test/files/run/existentials3-new.scala index 16735eab4f..110c8eff7a 100644 --- a/test/files/run/existentials3-new.scala +++ b/test/files/run/existentials3-new.scala @@ -38,31 +38,31 @@ object Test { println("%s, t=%s, s=%s".format(t, t.asInstanceOf[Product].productPrefix, s)) } def m[T: TypeTag](x: T) = printTpe(typeOf[T]) - def m2[T: AbsTypeTag](x: T) = printTpe(implicitly[AbsTypeTag[T]].tpe) + def m2[T: WeakTypeTag](x: T) = printTpe(implicitly[WeakTypeTag[T]].tpe) // tags do work for f10/g10 def main(args: Array[String]): Unit = { - m(f1) - m(f2) + m2(f1) + m2(f2) m(f3) m(f4) m(f5) m(f6) m(f7) - m(f8) - m(f9) + m2(f8) + m2(f9) m2(f10) m(f11) m(f12) - m(g1) - m(g2) + m2(g1) + m2(g2) m(g3) m(g4) m(g5) m(g6) m(g7) - m(g8) - m(g9) + m2(g8) + m2(g9) m2(g10) m(g11) m(g12) diff --git a/test/files/run/interop_manifests_are_abstypetags.scala b/test/files/run/interop_manifests_are_abstypetags.scala index 1cba2fdb4b..f2c2723106 100644 --- a/test/files/run/interop_manifests_are_abstypetags.scala +++ b/test/files/run/interop_manifests_are_abstypetags.scala @@ -1,11 +1,11 @@ import scala.reflect.runtime.universe._ object Test extends App { - def manifestIsAbsTypeTag[T: Manifest] = { - println(implicitly[AbsTypeTag[T]].tpe) + def manifestIsWeakTypeTag[T: Manifest] = { + println(implicitly[WeakTypeTag[T]].tpe) } - manifestIsAbsTypeTag[Int] - manifestIsAbsTypeTag[String] - manifestIsAbsTypeTag[Array[Int]] + manifestIsWeakTypeTag[Int] + manifestIsWeakTypeTag[String] + manifestIsWeakTypeTag[Array[Int]] }
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d1/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent-d1/Impls_Macros_1.scala index 2daf6fc3fb..69d9708b2a 100644 --- a/test/files/run/macro-def-path-dependent-d1/Impls_Macros_1.scala +++ b/test/files/run/macro-def-path-dependent-d1/Impls_Macros_1.scala @@ -5,5 +5,5 @@ import scala.reflect.api.Universe object Test { def materializeTypeTag[T](u: Universe)(e: T) = macro materializeTypeTag_impl[T] - def materializeTypeTag_impl[T: c.AbsTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? + def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? }
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d2/Impls_1.scala b/test/files/run/macro-def-path-dependent-d2/Impls_1.scala index 1cda64e43e..7fa9c3579e 100644 --- a/test/files/run/macro-def-path-dependent-d2/Impls_1.scala +++ b/test/files/run/macro-def-path-dependent-d2/Impls_1.scala @@ -3,5 +3,5 @@ import scala.reflect.macros.Context import scala.reflect.api.Universe object Impls { - def materializeTypeTag_impl[T: c.AbsTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? + def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? }
\ No newline at end of file diff --git a/test/files/run/macro-expand-implicit-argument/Macros_1.scala b/test/files/run/macro-expand-implicit-argument/Macros_1.scala index 7629c5a9e2..86c4198870 100644 --- a/test/files/run/macro-expand-implicit-argument/Macros_1.scala +++ b/test/files/run/macro-expand-implicit-argument/Macros_1.scala @@ -35,7 +35,7 @@ object Macros { * arr * } */ - def arrayMacro[A:c.AbsTypeTag](c:Context)(as:c.Expr[A]*)(ct: c.Expr[ClassTag[A]]): c.Expr[Array[A]] = { + def arrayMacro[A:c.WeakTypeTag](c:Context)(as:c.Expr[A]*)(ct: c.Expr[ClassTag[A]]): c.Expr[Array[A]] = { import c.mirror._ import c.universe._ def const(x:Int) = Literal(Constant(x)) @@ -44,7 +44,7 @@ object Macros { val arr = newTermName("arr") val create = Apply(Select(ct.tree, "newArray"), List(const(n))) - val arrtpe = TypeTree(implicitly[c.AbsTypeTag[Array[A]]].tpe) + val arrtpe = TypeTree(implicitly[c.WeakTypeTag[Array[A]]].tpe) val valdef = ValDef(Modifiers(), arr, arrtpe, create) val updates = (0 until n).map { diff --git a/test/files/run/macro-expand-nullary-generic/Impls_1.scala b/test/files/run/macro-expand-nullary-generic/Impls_1.scala index fbbc23a824..1180c83a40 100644 --- a/test/files/run/macro-expand-nullary-generic/Impls_1.scala +++ b/test/files/run/macro-expand-nullary-generic/Impls_1.scala @@ -2,14 +2,14 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def impl[T: c.AbsTypeTag](c: Ctx) = { + def impl[T: c.WeakTypeTag](c: Ctx) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works " + implicitly[c.AbsTypeTag[T]])))) + val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works " + implicitly[c.WeakTypeTag[T]])))) c.Expr[Unit](body) } - def fooNullary[T: c.AbsTypeTag](c: Ctx) = impl[T](c) - def fooEmpty[T: c.AbsTypeTag](c: Ctx)() = impl[T](c) - def barNullary[T: c.AbsTypeTag](c: Ctx)(x: c.Expr[Int]) = impl[T](c) - def barEmpty[T: c.AbsTypeTag](c: Ctx)(x: c.Expr[Int])() = impl[T](c) + def fooNullary[T: c.WeakTypeTag](c: Ctx) = impl[T](c) + def fooEmpty[T: c.WeakTypeTag](c: Ctx)() = impl[T](c) + def barNullary[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[Int]) = impl[T](c) + def barEmpty[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[Int])() = impl[T](c) }
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-explicit/Impls_1.scala b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala index 0a879687e8..72b420d92f 100644 --- a/test/files/run/macro-expand-tparams-explicit/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala @@ -2,9 +2,9 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[U: c.AbsTypeTag](c: Ctx) = { + def foo[U: c.WeakTypeTag](c: Ctx) = { import c.universe._ - val U = implicitly[c.AbsTypeTag[U]] + val U = implicitly[c.WeakTypeTag[U]] val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString)))) c.Expr[Unit](body) } diff --git a/test/files/run/macro-expand-tparams-implicit.check b/test/files/run/macro-expand-tparams-implicit.check index 1c1a785706..37226ec68d 100644 --- a/test/files/run/macro-expand-tparams-implicit.check +++ b/test/files/run/macro-expand-tparams-implicit.check @@ -1,2 +1,2 @@ TypeTag[Int]
-AbsTypeTag[String]
+WeakTypeTag[String]
diff --git a/test/files/run/macro-expand-tparams-implicit/Impls_1.scala b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala index f6cb63b9c9..33770516df 100644 --- a/test/files/run/macro-expand-tparams-implicit/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala @@ -2,9 +2,9 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[U: c.AbsTypeTag](c: Ctx)(x: c.Expr[U]) = { + def foo[U: c.WeakTypeTag](c: Ctx)(x: c.Expr[U]) = { import c.universe._ - val U = implicitly[c.AbsTypeTag[U]] + val U = implicitly[c.WeakTypeTag[U]] val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString)))) c.Expr[Unit](body) } diff --git a/test/files/run/macro-expand-tparams-prefix-a.check b/test/files/run/macro-expand-tparams-prefix-a.check index 6a7f9c5f52..7ef9fa7330 100644 --- a/test/files/run/macro-expand-tparams-prefix-a.check +++ b/test/files/run/macro-expand-tparams-prefix-a.check @@ -1,4 +1,4 @@ TypeTag[Int]
TypeTag[Int]
-AbsTypeTag[String]
+WeakTypeTag[String]
TypeTag[Boolean]
diff --git a/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala index f6cb63b9c9..33770516df 100644 --- a/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala @@ -2,9 +2,9 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[U: c.AbsTypeTag](c: Ctx)(x: c.Expr[U]) = { + def foo[U: c.WeakTypeTag](c: Ctx)(x: c.Expr[U]) = { import c.universe._ - val U = implicitly[c.AbsTypeTag[U]] + val U = implicitly[c.WeakTypeTag[U]] val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString)))) c.Expr[Unit](body) } diff --git a/test/files/run/macro-expand-tparams-prefix-b.check b/test/files/run/macro-expand-tparams-prefix-b.check index daae32bd0a..f4a2a8e80d 100644 --- a/test/files/run/macro-expand-tparams-prefix-b.check +++ b/test/files/run/macro-expand-tparams-prefix-b.check @@ -1,2 +1,2 @@ TypeTag[Boolean] TypeTag[Int]
-TypeTag[Boolean] AbsTypeTag[String]
+TypeTag[Boolean] WeakTypeTag[String]
diff --git a/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala index 7e0fa26569..9378e67712 100644 --- a/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala @@ -2,10 +2,10 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[T: c.AbsTypeTag, U: c.AbsTypeTag](c: Ctx)(x: c.Expr[U]) = { + def foo[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Ctx)(x: c.Expr[U]) = { import c.universe._ - val T = implicitly[c.AbsTypeTag[T]] - val U = implicitly[c.AbsTypeTag[U]] + val T = implicitly[c.WeakTypeTag[T]] + val U = implicitly[c.WeakTypeTag[U]] val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString + " " + U.toString)))) c.Expr[Unit](body) } diff --git a/test/files/run/macro-expand-tparams-prefix-c1.check b/test/files/run/macro-expand-tparams-prefix-c1.check index 5356b3e6d1..473668ac58 100644 --- a/test/files/run/macro-expand-tparams-prefix-c1.check +++ b/test/files/run/macro-expand-tparams-prefix-c1.check @@ -1,3 +1,3 @@ TypeTag[Int]
-AbsTypeTag[String]
+WeakTypeTag[String]
TypeTag[Boolean]
diff --git a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala index ca515be627..afdd7d4f7a 100644 --- a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala @@ -2,11 +2,11 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[T, U: c.AbsTypeTag, V](c: Ctx)(implicit T: c.AbsTypeTag[T], V: c.AbsTypeTag[V]): c.Expr[Unit] = { + def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ c.Expr(Block(List( Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.AbsTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(())))) } diff --git a/test/files/run/macro-expand-tparams-prefix-c2.check b/test/files/run/macro-expand-tparams-prefix-c2.check index 5356b3e6d1..473668ac58 100644 --- a/test/files/run/macro-expand-tparams-prefix-c2.check +++ b/test/files/run/macro-expand-tparams-prefix-c2.check @@ -1,3 +1,3 @@ TypeTag[Int]
-AbsTypeTag[String]
+WeakTypeTag[String]
TypeTag[Boolean]
diff --git a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala index 5a554590d8..3c2838208a 100644 --- a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala @@ -2,11 +2,11 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[T, U: c.AbsTypeTag, V](c: Ctx)(implicit T: c.AbsTypeTag[T], V: c.AbsTypeTag[V]): c.Expr[Unit] = { + def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ c.Expr(Block(List( Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.AbsTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(())))) } diff --git a/test/files/run/macro-expand-tparams-prefix-d1.check b/test/files/run/macro-expand-tparams-prefix-d1.check index 319edfbed0..2331e2549e 100644 --- a/test/files/run/macro-expand-tparams-prefix-d1.check +++ b/test/files/run/macro-expand-tparams-prefix-d1.check @@ -1,3 +1,3 @@ -AbsTypeTag[T]
-AbsTypeTag[U]
+WeakTypeTag[T]
+WeakTypeTag[U]
TypeTag[Boolean]
diff --git a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala index ca515be627..afdd7d4f7a 100644 --- a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala @@ -2,11 +2,11 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[T, U: c.AbsTypeTag, V](c: Ctx)(implicit T: c.AbsTypeTag[T], V: c.AbsTypeTag[V]): c.Expr[Unit] = { + def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ c.Expr(Block(List( Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.AbsTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(())))) } diff --git a/test/files/run/macro-impl-default-params/Impls_Macros_1.scala b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala index 06c58d96ab..db77b1923a 100644 --- a/test/files/run/macro-impl-default-params/Impls_Macros_1.scala +++ b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala @@ -2,10 +2,10 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo_targs[T, U: c.AbsTypeTag](c: Ctx = null)(x: c.Expr[Int] = null) = { + def foo_targs[T, U: c.WeakTypeTag](c: Ctx = null)(x: c.Expr[Int] = null) = { import c.{prefix => prefix} import c.universe._ - val U = implicitly[c.AbsTypeTag[U]] + val U = implicitly[c.WeakTypeTag[U]] val body = Block( Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo_targs...")))), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))), diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala index a54b7f4b08..4583a726cf 100644 --- a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala +++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala @@ -1,7 +1,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[T: c.AbsTypeTag](c: Ctx)(x: c.Expr[T]) = { + def foo[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[T]) = { import c.universe._ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(x.tree.toString)))) c.Expr[Unit](body) diff --git a/test/files/run/macro-reify-abstypetag-notypeparams/Test.scala b/test/files/run/macro-reify-abstypetag-notypeparams/Test.scala index 34f742b9fb..73c2d05921 100644 --- a/test/files/run/macro-reify-abstypetag-notypeparams/Test.scala +++ b/test/files/run/macro-reify-abstypetag-notypeparams/Test.scala @@ -1,6 +1,6 @@ import scala.reflect.runtime.universe._ object Test extends App { - println(implicitly[AbsTypeTag[Int]]) - println(implicitly[AbsTypeTag[List[Int]]]) + println(implicitly[WeakTypeTag[Int]]) + println(implicitly[WeakTypeTag[List[Int]]]) }
\ No newline at end of file diff --git a/test/files/run/macro-reify-abstypetag-typeparams-notags.check b/test/files/run/macro-reify-abstypetag-typeparams-notags.check index be62b59a69..6aeec96079 100644 --- a/test/files/run/macro-reify-abstypetag-typeparams-notags.check +++ b/test/files/run/macro-reify-abstypetag-typeparams-notags.check @@ -1,2 +1,2 @@ -AbsTypeTag[T]
-AbsTypeTag[List[T]]
+WeakTypeTag[T]
+WeakTypeTag[List[T]]
diff --git a/test/files/run/macro-reify-abstypetag-typeparams-notags/Test.scala b/test/files/run/macro-reify-abstypetag-typeparams-notags/Test.scala index 0b42cc07b5..4ba2231d9a 100644 --- a/test/files/run/macro-reify-abstypetag-typeparams-notags/Test.scala +++ b/test/files/run/macro-reify-abstypetag-typeparams-notags/Test.scala @@ -2,8 +2,8 @@ import scala.reflect.runtime.universe._ object Test extends App { def fooNoTypeTag[T] = { - println(implicitly[AbsTypeTag[T]]) - println(implicitly[AbsTypeTag[List[T]]]) + println(implicitly[WeakTypeTag[T]]) + println(implicitly[WeakTypeTag[List[T]]]) } fooNoTypeTag[Int] }
\ No newline at end of file diff --git a/test/files/run/macro-reify-abstypetag-typeparams-tags.check b/test/files/run/macro-reify-abstypetag-typeparams-tags.check index d6ca5a85ef..6e2646c5e0 100644 --- a/test/files/run/macro-reify-abstypetag-typeparams-tags.check +++ b/test/files/run/macro-reify-abstypetag-typeparams-tags.check @@ -1,2 +1,2 @@ TypeTag[Int]
-AbsTypeTag[List[Int]]
+WeakTypeTag[List[Int]]
diff --git a/test/files/run/macro-reify-abstypetag-typeparams-tags/Test.scala b/test/files/run/macro-reify-abstypetag-typeparams-tags/Test.scala index 82a7b7971d..70ca615e1f 100644 --- a/test/files/run/macro-reify-abstypetag-typeparams-tags/Test.scala +++ b/test/files/run/macro-reify-abstypetag-typeparams-tags/Test.scala @@ -1,9 +1,9 @@ import scala.reflect.runtime.universe._ object Test extends App { - def fooTypeTag[T: AbsTypeTag] = { - println(implicitly[AbsTypeTag[T]]) - println(implicitly[AbsTypeTag[List[T]]]) + def fooTypeTag[T: WeakTypeTag] = { + println(implicitly[WeakTypeTag[T]]) + println(implicitly[WeakTypeTag[List[T]]]) } fooTypeTag[Int] }
\ No newline at end of file diff --git a/test/files/run/macro-reify-abstypetag-usetypetag.check b/test/files/run/macro-reify-abstypetag-usetypetag.check index d6ca5a85ef..6e2646c5e0 100644 --- a/test/files/run/macro-reify-abstypetag-usetypetag.check +++ b/test/files/run/macro-reify-abstypetag-usetypetag.check @@ -1,2 +1,2 @@ TypeTag[Int]
-AbsTypeTag[List[Int]]
+WeakTypeTag[List[Int]]
diff --git a/test/files/run/macro-reify-abstypetag-usetypetag/Test.scala b/test/files/run/macro-reify-abstypetag-usetypetag/Test.scala index 3c62725c42..ecae4110a8 100644 --- a/test/files/run/macro-reify-abstypetag-usetypetag/Test.scala +++ b/test/files/run/macro-reify-abstypetag-usetypetag/Test.scala @@ -2,8 +2,8 @@ import scala.reflect.runtime.universe._ object Test extends App { def fooTypeTag[T: TypeTag] = { - println(implicitly[AbsTypeTag[T]]) - println(implicitly[AbsTypeTag[List[T]]]) + println(implicitly[WeakTypeTag[T]]) + println(implicitly[WeakTypeTag[List[T]]]) } fooTypeTag[Int] }
\ No newline at end of file diff --git a/test/files/run/macro-reify-freevars/Macros_1.scala b/test/files/run/macro-reify-freevars/Macros_1.scala index 57fdc32437..20f80c06d1 100644 --- a/test/files/run/macro-reify-freevars/Macros_1.scala +++ b/test/files/run/macro-reify-freevars/Macros_1.scala @@ -1,7 +1,7 @@ package scala.collection.slick object QueryableMacros{ - def map[T:c.AbsTypeTag, S:c.AbsTypeTag] + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] (c: scala.reflect.macros.Context) (projection: c.Expr[T => S]) : c.Expr[scala.collection.slick.Queryable[S]] = { diff --git a/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala b/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala index 04714970dd..ae2def2d3e 100644 --- a/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala +++ b/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala @@ -21,9 +21,9 @@ case class Utils[C <: Context]( c:C ) { } } object QueryableMacros{ - def _helper[C <: Context,S:c.AbsTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { import c.universe._ - val element_type = implicitly[c.AbsTypeTag[S]].tpe + val element_type = implicitly[c.WeakTypeTag[S]].tpe val foo = c.Expr[ru.Expr[Queryable[S]]]( c.reifyTree( c.runtimeUniverse, EmptyTree, c.typeCheck( Utils[c.type](c).removeDoubleReify( @@ -32,7 +32,7 @@ object QueryableMacros{ ))) c.universe.reify{ Queryable.factory[S]( foo.splice )} } - def map[T:c.AbsTypeTag, S:c.AbsTypeTag] + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] (c: scala.reflect.macros.Context) (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) } diff --git a/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala b/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala index 04714970dd..ae2def2d3e 100644 --- a/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala +++ b/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala @@ -21,9 +21,9 @@ case class Utils[C <: Context]( c:C ) { } } object QueryableMacros{ - def _helper[C <: Context,S:c.AbsTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { + def _helper[C <: Context,S:c.WeakTypeTag]( c:C )( name:String, projection:c.Expr[_] ) = { import c.universe._ - val element_type = implicitly[c.AbsTypeTag[S]].tpe + val element_type = implicitly[c.WeakTypeTag[S]].tpe val foo = c.Expr[ru.Expr[Queryable[S]]]( c.reifyTree( c.runtimeUniverse, EmptyTree, c.typeCheck( Utils[c.type](c).removeDoubleReify( @@ -32,7 +32,7 @@ object QueryableMacros{ ))) c.universe.reify{ Queryable.factory[S]( foo.splice )} } - def map[T:c.AbsTypeTag, S:c.AbsTypeTag] + def map[T:c.WeakTypeTag, S:c.WeakTypeTag] (c: scala.reflect.macros.Context) (projection: c.Expr[T => S]): c.Expr[Queryable[S]] = _helper[c.type,S]( c )( "_map", projection ) } diff --git a/test/files/run/macro-reify-tagful-a/Macros_1.scala b/test/files/run/macro-reify-tagful-a/Macros_1.scala index 0eac74236f..f2512dcfaf 100644 --- a/test/files/run/macro-reify-tagful-a/Macros_1.scala +++ b/test/files/run/macro-reify-tagful-a/Macros_1.scala @@ -5,7 +5,7 @@ object Macros { def foo[T](s: T) = macro Impls.foo[T] object Impls { - def foo[T: c.AbsTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify { + def foo[T: c.WeakTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify { List(s.splice) } } diff --git a/test/files/run/macro-reify-tagless-a.check b/test/files/run/macro-reify-tagless-a.check index d69f641280..c2385ba008 100644 --- a/test/files/run/macro-reify-tagless-a.check +++ b/test/files/run/macro-reify-tagless-a.check @@ -1,3 +1,3 @@ reflective compilation has failed:
-Macro expansion contains free type variable T defined by foo in Impls_Macros_1.scala:7:13. Have you forgotten to use c.AbsTypeTag annotation for this type parameter? If you have troubles tracking free type variables, consider using -Xlog-free-types
+Macro expansion contains free type variable T defined by foo in Impls_Macros_1.scala:7:13. Have you forgotten to use c.WeakTypeTag annotation for this type parameter? If you have troubles tracking free type variables, consider using -Xlog-free-types
diff --git a/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala index b2f6f7d50e..f693ad78cc 100644 --- a/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala +++ b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala @@ -18,7 +18,8 @@ object Macros { val rupkg = c.mirror.staticModule("scala.reflect.runtime.package") val rusym = build.selectTerm(rupkg, "universe") val NullaryMethodType(rutpe) = rusym.typeSignature - val ru = build.newFreeTerm("ru", rutpe, scala.reflect.runtime.universe) + val ru = build.newFreeTerm("ru", scala.reflect.runtime.universe) + build.setTypeSignature(ru, rutpe) val tree2 = Apply(Select(Ident(ru), newTermName("reify")), List(Literal(Constant(2)))) val ttree2 = c.typeCheck(tree2, withMacrosDisabled = true) diff --git a/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala b/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala index 948c047351..1dbf5a1a87 100644 --- a/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala +++ b/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala @@ -18,7 +18,8 @@ object Macros { val rupkg = c.mirror.staticModule("scala.reflect.runtime.package") val rusym = build.selectTerm(rupkg, "universe") val NullaryMethodType(rutpe) = rusym.typeSignature - val ru = build.newFreeTerm("ru", rutpe, scala.reflect.runtime.universe) + val ru = build.newFreeTerm("ru", scala.reflect.runtime.universe) + build.setTypeSignature(ru, rutpe) val tree2 = Apply(Select(Ident(ru), newTermName("reify")), List(Apply(Select(Ident(newTermName("scala")), newTermName("Array")), List(Literal(Constant(2)))))) val ttree2 = c.typeCheck(tree2, withMacrosDisabled = true) diff --git a/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala b/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala index 3d350a50fa..bcbd12817b 100644 --- a/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala +++ b/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala @@ -2,13 +2,13 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.Context object Macros { - def cons_impl[A: c.AbsTypeTag](c: Context)(x: c.Expr[A], xs: c.Expr[List[A]]): c.Expr[List[A]] = c.universe.reify { - println("A = " + c.literal(implicitly[c.AbsTypeTag[A]].toString).splice) + def cons_impl[A: c.WeakTypeTag](c: Context)(x: c.Expr[A], xs: c.Expr[List[A]]): c.Expr[List[A]] = c.universe.reify { + println("A = " + c.literal(implicitly[c.WeakTypeTag[A]].toString).splice) x.splice :: xs.splice } - def nil_impl[B: c.AbsTypeTag](c: Context): c.Expr[List[B]] = c.universe.reify { - println("B = " + c.literal(implicitly[c.AbsTypeTag[B]].toString).splice) + def nil_impl[B: c.WeakTypeTag](c: Context): c.Expr[List[B]] = c.universe.reify { + println("B = " + c.literal(implicitly[c.WeakTypeTag[B]].toString).splice) Nil } diff --git a/test/files/run/macro-undetparams-macroitself.check b/test/files/run/macro-undetparams-macroitself.check index 1c1a785706..37226ec68d 100644 --- a/test/files/run/macro-undetparams-macroitself.check +++ b/test/files/run/macro-undetparams-macroitself.check @@ -1,2 +1,2 @@ TypeTag[Int]
-AbsTypeTag[String]
+WeakTypeTag[String]
diff --git a/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala b/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala index 081894cf52..0244273b6f 100644 --- a/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala +++ b/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala @@ -2,7 +2,7 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.Context object Macros { - def impl[T: c.AbsTypeTag](c: Context)(foo: c.Expr[T]): c.Expr[Unit] = c.universe.reify { println(c.literal(implicitly[c.AbsTypeTag[T]].toString).splice) } + def impl[T: c.WeakTypeTag](c: Context)(foo: c.Expr[T]): c.Expr[Unit] = c.universe.reify { println(c.literal(implicitly[c.WeakTypeTag[T]].toString).splice) } def foo[T](foo: T) = macro impl[T] }
\ No newline at end of file diff --git a/test/files/run/reify_newimpl_26.check b/test/files/run/reify_newimpl_26.check index c006cb7ffb..5996f3b322 100644 --- a/test/files/run/reify_newimpl_26.check +++ b/test/files/run/reify_newimpl_26.check @@ -5,16 +5,16 @@ scala> scala> def foo[T]{
import scala.reflect.runtime.universe._
- val tt = implicitly[AbsTypeTag[List[T]]]
+ val tt = implicitly[WeakTypeTag[List[T]]]
println(tt)
}
<console>:9: free type: Ident(newTypeName("T")) defined by foo in <console>:7:16
- val tt = implicitly[AbsTypeTag[List[T]]]
+ val tt = implicitly[WeakTypeTag[List[T]]]
^
foo: [T]=> Unit
scala> foo[Int]
-AbsTypeTag[scala.List[T]]
+WeakTypeTag[scala.List[T]]
scala>
diff --git a/test/files/run/reify_newimpl_26.scala b/test/files/run/reify_newimpl_26.scala index a12d8a2970..af74d60e8b 100644 --- a/test/files/run/reify_newimpl_26.scala +++ b/test/files/run/reify_newimpl_26.scala @@ -5,7 +5,7 @@ object Test extends ReplTest { def code = """ def foo[T]{ import scala.reflect.runtime.universe._ - val tt = implicitly[AbsTypeTag[List[T]]] + val tt = implicitly[WeakTypeTag[List[T]]] println(tt) } foo[Int] diff --git a/test/files/run/t1195-new.scala b/test/files/run/t1195-new.scala index 4edfb5073f..0f62b140c9 100644 --- a/test/files/run/t1195-new.scala +++ b/test/files/run/t1195-new.scala @@ -9,7 +9,7 @@ object Test { val g1 = g() val h1 = h() - def m[T: TypeTag](x: T) = println(typeOf[T] + ", underlying = " + typeOf[T].typeSymbol.typeSignature) + def m[T: WeakTypeTag](x: T) = println(weakTypeOf[T] + ", underlying = " + weakTypeOf[T].typeSymbol.typeSignature) def main(args: Array[String]): Unit = { m(f) diff --git a/test/files/run/t6323b.check b/test/files/run/t6323b.check new file mode 100644 index 0000000000..80b6176178 --- /dev/null +++ b/test/files/run/t6323b.check @@ -0,0 +1 @@ +cannot reflect value a, because it's a member of a weak type Test
diff --git a/test/files/run/t6323b.scala b/test/files/run/t6323b.scala new file mode 100644 index 0000000000..f530ac3ecc --- /dev/null +++ b/test/files/run/t6323b.scala @@ -0,0 +1,21 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => m} +import scala.reflect.runtime.{universe => u} + +object Test extends App { + locally { + try { + case class Test(a:String,b:List[Int]) + + val lookAtMe = m.reflect(Test("a",List(5))) + val value = u.weakTypeOf[Test] + val members = value.members + val member = value.members.filter(_.name.encoded == "a") + val aAccessor = lookAtMe.reflectMethod(member.head.asMethod) + val thisShouldBeA = aAccessor.apply() + println(thisShouldBeA) + } catch { + case ScalaReflectionException(msg) => println(msg) + } + } +}
\ No newline at end of file diff --git a/test/files/run/toolbox_typecheck_macrosdisabled.scala b/test/files/run/toolbox_typecheck_macrosdisabled.scala index 01a418d42e..51eb63f294 100644 --- a/test/files/run/toolbox_typecheck_macrosdisabled.scala +++ b/test/files/run/toolbox_typecheck_macrosdisabled.scala @@ -12,7 +12,8 @@ object Test extends App { val rupkg = cm.staticModule("scala.reflect.runtime.package") val rusym = build.selectTerm(rupkg, "universe") val NullaryMethodType(rutpe) = rusym.typeSignature - val ru = build.newFreeTerm("ru", rutpe, scala.reflect.runtime.universe) + val ru = build.newFreeTerm("ru", scala.reflect.runtime.universe) + build.setTypeSignature(ru, rutpe) val tree1 = Apply(Select(Ident(ru), newTermName("reify")), List(Literal(Constant(2)))) val ttree1 = toolbox.typeCheck(tree1, withMacrosDisabled = false) diff --git a/test/files/run/toolbox_typecheck_macrosdisabled2.scala b/test/files/run/toolbox_typecheck_macrosdisabled2.scala index 462dc9fa91..74fd09d9fd 100644 --- a/test/files/run/toolbox_typecheck_macrosdisabled2.scala +++ b/test/files/run/toolbox_typecheck_macrosdisabled2.scala @@ -12,7 +12,8 @@ object Test extends App { val rupkg = cm.staticModule("scala.reflect.runtime.package") val rusym = build.selectTerm(rupkg, "universe") val NullaryMethodType(rutpe) = rusym.typeSignature - val ru = build.newFreeTerm("ru", rutpe, scala.reflect.runtime.universe) + val ru = build.newFreeTerm("ru", scala.reflect.runtime.universe) + build.setTypeSignature(ru, rutpe) val tree1 = Apply(Select(Ident(ru), newTermName("reify")), List(Apply(Select(Ident(newTermName("scala")), newTermName("Array")), List(Literal(Constant(2)))))) val ttree1 = toolbox.typeCheck(tree1, withMacrosDisabled = false) |