File tree 3 files changed +7
-3
lines changed 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
- str_from_macro 1st 2nd
1
+ test single: (1st case arg1) outside
2
+ test curried: (2nd case arg1, arg2) outside
Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ inline def testExpr(inline body: Any) = ${ testExprImpl('body) }
4
4
def testExprImpl (body : Expr [Any ])(using Quotes ): Expr [String ] =
5
5
body match
6
6
case ' { def g (y : String ) = " placeholder" + y; $a(g): String } =>
7
- ' { $a((z: String ) => " str_from_macro " + z) }
7
+ ' { $a((z : String ) => s " (1st case ${z}) " ) }
8
+ case ' { def g (y : String )(z : String ) = " placeholder" + y; $a(g): String } =>
9
+ ' { $a((z1 : String ) => (z2 : String ) => s " (2nd case ${z1}, ${z2}) " ) }
8
10
case _ => Expr (" not matched" )
9
11
10
12
// TODO issue-17105: Clean this up if not neccessary
Original file line number Diff line number Diff line change 1
1
@ main def Test : Unit =
2
- println(testExpr { def f (x : String ) = " placeholder" + x; f(" 1st" ) + " 2nd" })
2
+ println(" test single: " + testExpr { def f (x : String ) = " placeholder" + x; f(" arg1" ) + " outside" })
3
+ println(" test curried: " + testExpr { def f (x : String )(y : String ) = " placeholder" + x; f(" arg1" )(" args2" ) + " outside" })
You can’t perform that action at this time.
0 commit comments