File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ def testExprImpl(body: Expr[Any])(using Quotes): Expr[String] =
7
7
' { $a((z : String ) => s " [1st case] ${z}" ) }
8
8
case ' { def g (y : String )(z : String ) = " placeholder" + y; $a(g): String } =>
9
9
' { $a((z1 : String ) => (z2 : String ) => s " [2nd case] ${z1}, ${z2}" ) }
10
+ case ' { given i : String = " given" ; def g (using s : String ) = " placeholder" ; $a(g, i): String } =>
11
+ ' { $a((s : String ) => s " [3rd case] ${s}" )(0 ) }
12
+ /* TODO issue-17105: This causes type error due to another issue from issue-17105 */
13
+ // case '{ def g(using s: String) = "placeholder"; $a(g) } =>
14
+ // '{ $a((s: String) => s"[3rd case] ${s}") }
10
15
case _ => Expr (" not matched" )
11
16
12
17
// TODO issue-17105: Clean this up if not neccessary
Original file line number Diff line number Diff line change 3
3
println(" case curried: " + testExpr { def f (x : String )(y : String ) = " placeholder" + x; f(" arg1" )(" arg2" ) + " outside" })
4
4
def outer () = " outer-method"
5
5
println(" case methods from outer scope: " + testExpr { def f (x : String ) = " placeholder" + x; f(" arg1" ) + outer() })
6
+ println(" case contextual params: " + testExpr { given String = " given" ; def f (using t : String ) = " placeholder" ; f + " outside" })
You can’t perform that action at this time.
0 commit comments