Created
June 3, 2023 14:48
-
-
Save zeptometer/d1724f6fdc82d2ff23868ec50aea539c to your computer and use it in GitHub Desktop.
Issue-17105 test case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Macro_1.scala | |
import scala.quoted.* | |
inline def testExpr(inline body: Any) = ${ testExprImpl('body) } | |
def testExprImpl(body: Expr[Any])(using Quotes): Expr[String] = | |
body match | |
case '{ def g(y: Int) = "hello" * y; $a(g): String } => | |
'{ $a((z:Int) => "this is " + z.toString()) } | |
case _ => Expr("not matched") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test_2.scala | |
def app = | |
testExpr { def f(x: Int) = "hello" * x; f(0) + "bye" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment