aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/reify_copypaste1.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/disabled/macro/run/reify_copypaste1.scala')
-rw-r--r--tests/disabled/macro/run/reify_copypaste1.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/disabled/macro/run/reify_copypaste1.scala b/tests/disabled/macro/run/reify_copypaste1.scala
new file mode 100644
index 000000000..e255403ad
--- /dev/null
+++ b/tests/disabled/macro/run/reify_copypaste1.scala
@@ -0,0 +1,19 @@
+import scala.reflect.runtime._
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.universe.definitions._
+import scala.reflect.runtime.universe.Flag._
+import scala.tools.reflect.ToolBox
+
+object Test extends dotty.runtime.LegacyApp {
+ val stdout = System.out
+ val output = new java.io.ByteArrayOutputStream()
+ System.setOut(new java.io.PrintStream(output))
+ val toolBox = currentMirror.mkToolBox(options = "-Yreify-copypaste")
+ val reify = Select(Select(Select(Select(Ident(ScalaPackage), TermName("reflect")), TermName("runtime")), TermName("universe")), TermName("reify"))
+ val reifee = Block(List(ValDef(Modifiers(LAZY), TermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(TermName("x")))
+ toolBox.eval(Apply(reify, List(reifee)))
+ val Block(List(tpeCopypaste, exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))), Literal(Constant(()))) = toolBox.parse(output.toString())
+ output.reset()
+ toolBox.eval(Block(stats, expr))
+ stdout.println(output.toString)
+}