aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams
diff options
context:
space:
mode:
Diffstat (limited to 'tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams')
-rw-r--r--tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala13
-rw-r--r--tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala8
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala
new file mode 100644
index 000000000..8b5c59bde
--- /dev/null
+++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.macros.blackbox.Context
+
+object Impls {
+ def foo[T: c.WeakTypeTag](c: Context)(x: c.Expr[T]) = {
+ import c.universe._
+ val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(x.tree.toString))))
+ c.Expr[Unit](body)
+ }
+}
+
+object Macros {
+ def foo[T](x: T) = macro Impls.foo[T]
+} \ No newline at end of file
diff --git a/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala
new file mode 100644
index 000000000..ba763eda5
--- /dev/null
+++ b/tests/disabled/macro/run/macro-invalidusage-partialapplication-with-tparams/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) }
+}