We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9db2747 commit a575a08Copy full SHA for a575a08
tests/run-macros/i8745b/Macro_1.scala
@@ -0,0 +1,15 @@
1
+import scala.quoted._
2
+
3
+object Companion {
4
+ def fun(first: String): String = "anything"
5
+}
6
7
+object Macro {
8
+ inline def mac(inline tree: String): String = ${ macImpl('tree) }
9
+ def macImpl(tree: Expr[String])(using qctx: QuoteContext): Expr[String] = {
10
+ tree match {
11
+ case vv @ '{ ($s: Companion.type).fun($arg) } => arg
12
+ case _ => ???
13
+ }
14
15
tests/run-macros/i8745b/Test_2.scala
@@ -0,0 +1,6 @@
+import Macro._
+@main def Test() = { //hello
+ import Companion._
+ mac(fun("blah"))
0 commit comments