Open
Description
Compiler version
Latest Nightly: scala-3.0.2-RC1-bin-20210626-f33bc8d-NIGHTLY
Minimized code
Create a global function in a namespace (e.g. Dsl
). Then export it:
package io.getquill.mytest
object Dsl:
def stuff: String = ???
export Dsl._
Then make a quoted-match clause to match it:
object ParseMacro:
inline def parse(inline any: Any): Unit = ${ parseImpl('any) }
def parseImpl(any: Expr[Any])(using Quotes): Expr[Unit] =
import quotes.reflect._
any match
case '{ Dsl.stuff } => println("Matched!")
case _ => println("Did not match")
'{ () }
Then use the macro to match it based on the export:
import mytest._
ParseMacro.parse(stuff)
It will not match.
Output
The clause does not match i.e. Did not match
is printed.
Expectation
The clause should match the exported symbol.
Repo
Example code can be found here:
https://github.com/deusaquilus/export_match_issue