summaryrefslogtreecommitdiff
path: root/test/files/pos/t7649.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-07-11 12:15:35 +1000
committerJason Zaugg <jzaugg@gmail.com>2013-07-11 16:48:23 +1000
commit6368ae7218c0af651f74a566f718a8b03a547ba2 (patch)
tree9348318629c243a120c8c3ab39100c6e05b90628 /test/files/pos/t7649.scala
parent54cb6af7dbcf630a4f57e98f0099d77dd3b36693 (diff)
downloadscala-6368ae7218c0af651f74a566f718a8b03a547ba2.tar.gz
scala-6368ae7218c0af651f74a566f718a8b03a547ba2.tar.bz2
scala-6368ae7218c0af651f74a566f718a8b03a547ba2.zip
SI-7649 Fix positions for reshaped tag materializers
Calls to `materializeClassTag[T]` are replaced during reification with `implicitly[ClassTag[T]]` in the `reify` macro. This is done to avoid referring to symbols in scala-compiler.jar. Class- and Type-Tag materialization is treated in the same way. This commit positions the replacement trees to avoid triggering assertions under -Yrangepos.
Diffstat (limited to 'test/files/pos/t7649.scala')
-rw-r--r--test/files/pos/t7649.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/t7649.scala b/test/files/pos/t7649.scala
new file mode 100644
index 0000000000..a1b02f63f1
--- /dev/null
+++ b/test/files/pos/t7649.scala
@@ -0,0 +1,20 @@
+object Test {
+ val c: reflect.macros.Context = ???
+ import c.universe._
+ reify {
+ // The lookup of the implicit WeakTypeTag[Any]
+ // was triggering an unpositioned tree.
+ c.Expr[Any](Literal(Constant(0))).splice
+ }
+
+ import scala.reflect.ClassTag
+ def ct[A: ClassTag]: Expr[A] = ???
+ def tt[A: TypeTag]: Expr[A] = ???
+ def wtt[A: WeakTypeTag]: Expr[A] = ???
+
+ reify {
+ ct[String].splice
+ tt[String].splice
+ wtt[String].splice
+ }
+}