Skip to content

Commit b0840a6

Browse files
committed
Better test.
1 parent fd4676b commit b0840a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/pos/splice-pat.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ object MyMatcher2 {
99
}
1010

1111
def foo(x: Any): Unit = ???
12-
def bar(x: Int): Unit = ???
12+
def bar(x: Int): Int = ???
1313

1414
def oneLevel(expr: Expr[Any])(using Quotes): Expr[Int] = expr match
1515
case '{ foo(${MyMatcher(y@MyMatcher2())}) } => y
1616

1717
def twoLevel(expr: Expr[Any])(using Quotes): Expr[Int] = expr match
1818
case '{ foo(${MyMatcher('{ bar(${y@MyMatcher2()}).getClass}) }) } => y
19+
20+
def bindQuote(expr: Expr[Any])(using Quotes): Expr[Int] = expr match
21+
case '{ foo(${y@'{bar($_)}})} => y

0 commit comments

Comments
 (0)