diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-07-11 12:15:35 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-07-11 16:48:23 +1000 |
commit | 6368ae7218c0af651f74a566f718a8b03a547ba2 (patch) | |
tree | 9348318629c243a120c8c3ab39100c6e05b90628 /test/files/pos | |
parent | 54cb6af7dbcf630a4f57e98f0099d77dd3b36693 (diff) | |
download | scala-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')
-rw-r--r-- | test/files/pos/t7649.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t7649.scala | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/files/pos/t7649.flags b/test/files/pos/t7649.flags new file mode 100644 index 0000000000..fcf951d907 --- /dev/null +++ b/test/files/pos/t7649.flags @@ -0,0 +1 @@ +-Yrangepos
\ No newline at end of file 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 + } +} |