File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
- case 1: [3rd case] another_given outside
2
- case 2: [3rd case] given outside
1
+ case 1: [matched 1st case] another_given outside
2
+ case 2: [matched 2nd case] given outside
3
+ case 3: [matched 1st case] another_given outside
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ inline def testCtxParam(inline body: Any) = ${ testCtxParamImpl('body) }
4
4
def testCtxParamImpl (body : Expr [Any ])(using Quotes ): Expr [String ] =
5
5
body match
6
6
case ' { given i : String = " given" ; def g (using s : String ) = " placeholder" ; $a(g, i): String } =>
7
- ' { $a(((s : String ) ?=> s " [3rd case] ${s}" ), " another_given" ) }
7
+ ' { $a(((s : String ) ?=> s " [matched 1st case] ${s}" ), " another_given" ) }
8
8
case ' { def g (using s : String ) = " placeholder" ; $a(g): String } =>
9
- ' { $a((s : String ) ?=> s " [3rd case] ${s}" ) }
9
+ ' { $a((s : String ) ?=> s " [matched 2nd case] ${s}" ) }
10
10
case _ => Expr (" not matched" )
Original file line number Diff line number Diff line change 2
2
println(" case 1: " + testCtxParam { given String = " given" ; def f (using t : String ) = " placeholder" ; f + " outside" })
3
3
given String = " given"
4
4
println(" case 2: " + testCtxParam { def f (using t : String ) = " placeholder" ; f + " outside" })
5
+ /* This is expected to match the first case. The current QuoteMatcher identifies a function with a contextual function. */
6
+ println(" case 3: " + testCtxParam { given i : String = " given" ; def a (x : String ) = " placeholder" ; a(i) + " outside" } )
You can’t perform that action at this time.
0 commit comments