aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala')
-rw-r--r--tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala
new file mode 100644
index 000000000..b623d8820
--- /dev/null
+++ b/tests/disabled/macro/run/macro-parse-position-malformed/Impls_Macros_1.scala
@@ -0,0 +1,18 @@
+import scala.language.experimental.macros
+import scala.reflect.macros.blackbox.Context
+import scala.reflect.macros.ParseException
+
+object Macros {
+ def impl(c: Context)() = {
+ import c.universe._
+ val out = try {
+ c.parse("foo(bar")
+ "didn't fail"
+ } catch {
+ case e: ParseException =>
+ s"failed with '${e.pos}' position and '${e.msg}' message"
+ }
+ c.Expr[String](Literal(Constant(out)))
+ }
+ def foo(): String = macro impl
+} \ No newline at end of file