diff --git a/tests/run-macros/i6765-b.check b/tests/run-macros/i6765-b.check new file mode 100644 index 000000000000..5b3a32df1825 --- /dev/null +++ b/tests/run-macros/i6765-b.check @@ -0,0 +1,8 @@ +{ + val x$1: java.lang.String = "One" + scala.Nil.::[java.lang.String](x$1) +} +{ + val x$1: java.lang.String = "One" + scala.Nil.::[java.lang.String](x$1) +} diff --git a/tests/run-macros/i6765-b/Macro_1.scala b/tests/run-macros/i6765-b/Macro_1.scala new file mode 100644 index 000000000000..b1977d73c388 --- /dev/null +++ b/tests/run-macros/i6765-b/Macro_1.scala @@ -0,0 +1,9 @@ +import scala.quoted._ +import delegate scala.quoted._ + +inline def foo = ${fooImpl} + +def fooImpl given (qctx: QuoteContext) = { + val res = List('{"One"}).toExprOfList + res.show.toExpr +} diff --git a/tests/run-macros/i6765-b/Test_2.scala b/tests/run-macros/i6765-b/Test_2.scala new file mode 100644 index 000000000000..4900ac973855 --- /dev/null +++ b/tests/run-macros/i6765-b/Test_2.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + val res = foo + println(res) + + println(foo) + } +} diff --git a/tests/run-macros/i6765.check b/tests/run-macros/i6765.check new file mode 100644 index 000000000000..5b3a32df1825 --- /dev/null +++ b/tests/run-macros/i6765.check @@ -0,0 +1,8 @@ +{ + val x$1: java.lang.String = "One" + scala.Nil.::[java.lang.String](x$1) +} +{ + val x$1: java.lang.String = "One" + scala.Nil.::[java.lang.String](x$1) +} diff --git a/tests/run-macros/i6765/Macro_1.scala b/tests/run-macros/i6765/Macro_1.scala new file mode 100644 index 000000000000..de5709fd9b05 --- /dev/null +++ b/tests/run-macros/i6765/Macro_1.scala @@ -0,0 +1,12 @@ +import scala.quoted._ +import delegate scala.quoted._ + +delegate for Toolbox = Toolbox.make(getClass.getClassLoader) + +inline def foo = ${fooImpl} + +def fooImpl given (qctx: QuoteContext) = { + import qctx.tasty._ + val res = List('{"One"}).toExprOfList + res.show.toExpr +} diff --git a/tests/run-macros/i6765/Test_2.scala b/tests/run-macros/i6765/Test_2.scala new file mode 100644 index 000000000000..4900ac973855 --- /dev/null +++ b/tests/run-macros/i6765/Test_2.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + val res = foo + println(res) + + println(foo) + } +}