Skip to content

Commit f36948c

Browse files
committed
Add failing test case for contextual parameters
1 parent 0cffa8f commit f36948c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/run-macros/i17105/Macro_1.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ def testExprImpl(body: Expr[Any])(using Quotes): Expr[String] =
77
'{ $a((z: String) => s"[1st case] ${z}") }
88
case '{ def g(y: String)(z: String) = "placeholder" + y; $a(g): String } =>
99
'{ $a((z1: String) => (z2: String) => s"[2nd case] ${z1}, ${z2}") }
10+
case '{ def g(using s: String) = "placeholder"; $a(g) } =>
11+
'{ $a((s: String) => s"[3rd case] ${s}") }
1012
case _ => Expr("not matched")
1113

1214
// TODO issue-17105: Clean this up if not neccessary

tests/run-macros/i17105/Test_2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
println("case curried: " + testExpr { def f(x: String)(y: String) = "placeholder" + x; f("arg1")("arg2") + " outside" })
44
def outer() = " outer-method"
55
println("case methods from outer scope: " + testExpr { def f(x: String) = "placeholder" + x; f("arg1") + outer() })
6+
given String = "given"
7+
println("case contextual params: " + testExpr { def f(using t: String) = "placeholder"; f + " outside" })

0 commit comments

Comments
 (0)