aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/macro-abort-fresh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/disabled/macro/run/macro-abort-fresh')
-rw-r--r--tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala15
-rw-r--r--tests/disabled/macro/run/macro-abort-fresh/Test_2.scala8
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala b/tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala
new file mode 100644
index 000000000..2b03512ef
--- /dev/null
+++ b/tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.macros.blackbox.Context
+
+object Impls {
+ def impl(c: Context) = {
+ import c.universe._
+ println(c.fresh())
+ println(c.fresh("qwe"))
+ println(c.fresh(TypeName("qwe")))
+ c.abort(NoPosition, "blargh")
+ }
+}
+
+object Macros {
+ def foo = macro Impls.impl
+} \ No newline at end of file
diff --git a/tests/disabled/macro/run/macro-abort-fresh/Test_2.scala b/tests/disabled/macro/run/macro-abort-fresh/Test_2.scala
new file mode 100644
index 000000000..dea6e6d62
--- /dev/null
+++ b/tests/disabled/macro/run/macro-abort-fresh/Test_2.scala
@@ -0,0 +1,8 @@
+object Test extends dotty.runtime.LegacyApp {
+ import scala.reflect.runtime.universe._
+ import scala.reflect.runtime.{currentMirror => cm}
+ import scala.tools.reflect.ToolBox
+ val tree = Select(Ident(TermName("Macros")), TermName("foo"))
+ try cm.mkToolBox().eval(tree)
+ catch { case ex: Throwable => println(ex.getMessage) }
+} \ No newline at end of file