From 676d895b7827f988b95a23c5bf7d40719fa438fe Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 20 Sep 2012 22:02:18 +0200 Subject: SI-6381 Honour -Yrangepos in the REPL --- test/files/run/t6381.check | 17 +++++++++++++++++ test/files/run/t6381.scala | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/files/run/t6381.check create mode 100644 test/files/run/t6381.scala (limited to 'test/files') 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" +} -- cgit v1.2.3