diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-09-20 22:02:18 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-09-20 22:05:01 +0200 |
commit | 676d895b7827f988b95a23c5bf7d40719fa438fe (patch) | |
tree | 5b723cf2fae7ceb4a8826506c018942882aa2922 /test | |
parent | feb77881ff8bc1e46c8ae4317a9d95cbf97e34bd (diff) | |
download | scala-676d895b7827f988b95a23c5bf7d40719fa438fe.tar.gz scala-676d895b7827f988b95a23c5bf7d40719fa438fe.tar.bz2 scala-676d895b7827f988b95a23c5bf7d40719fa438fe.zip |
SI-6381 Honour -Yrangepos in the REPL
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t6381.check | 17 | ||||
-rw-r--r-- | test/files/run/t6381.scala | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/run/t6381.check b/test/files/run/t6381.check new file mode 100644 index 0000000000..b51cfd0398 --- /dev/null +++ b/test/files/run/t6381.check @@ -0,0 +1,17 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import language.experimental.macros +import language.experimental.macros + +scala> def pos_impl(c: reflect.macros.Context): c.Expr[String] = + c.literal(c.enclosingPosition.getClass.toString) +pos_impl: (c: scala.reflect.macros.Context)c.Expr[String] + +scala> def pos = macro pos_impl +pos: String + +scala> pos +res0: String = class scala.reflect.internal.util.RangePosition + +scala> diff --git a/test/files/run/t6381.scala b/test/files/run/t6381.scala new file mode 100644 index 0000000000..859ec3cb30 --- /dev/null +++ b/test/files/run/t6381.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import language.experimental.macros + |def pos_impl(c: reflect.macros.Context): c.Expr[String] = + | c.literal(c.enclosingPosition.getClass.toString) + |def pos = macro pos_impl + |pos + |""".stripMargin.trim + + override def extraSettings: String = "-Yrangepos" +} |