-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bug
Description
Compiler version
3.2
Minimized code
// Macro_1.scala
import scala.quoted.*
inline def test: String = ${ testExpr }
def testExpr(using Quotes): Expr[String] =
'{ def f(x: Int) = 1; f(3) } match
case '{ def g(y: Int) = 1; $a(g): Int } => Expr(a.show)
case _ => Expr("not matched")
// Test_2.scala
def app = test
Output
scalac -Xprint:inlining Macro_1.scala Test_2.scala
package <empty> {
final lazy module val Test_2$package: Test_2$package = new Test_2$package()
@SourceFile("t/Test_2.scala") final module class Test_2$package() extends
Object() { this: Test_2$package.type =>
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[Test_2$package.type])
def app: String = "not matched":String
}
}
Expectation
The quote pattern should match and the result should be something like
def app: String = "(g: Int => Int) => g(3)":String
Metadata
Metadata
Assignees
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bug