Skip to content

Commit 48da272

Browse files
committed
wip
1 parent 7783f73 commit 48da272

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

tests/pos/quotedPatterns.scala

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@ object Test {
66
def g(x: Int, y: Int) = x * y
77

88
def res given tasty.Reflection: quoted.Expr[Int] = x match {
9-
// case '{1 + 2} => '{0}
10-
// case '{f($y)} => y
11-
// case '{g($y, $z)} => '{$y * $z}
12-
// case '{ ((a: Int) => 3)($y) } => y
13-
// case '{ 1 + ($y: Int)} => y
14-
// case '{ val a = 1 + ($y: Int); 3 } => y
15-
// // currently gives an unreachable case warning
16-
// // but only when used in conjunction with the others.
17-
// // I believe this is because implicit arguments are not taken
18-
// // into account when checking whether we have already seen an `unapply` before.
19-
// case '{ val $y: Int = $z; 1 } => z
20-
// case '{ ((`$y`: Int) => 1 + y + ($z: Int))(2) } => z
21-
case '{ Option(1) match { case Some($n) => $z } } => z
22-
// TODO support syntax
9+
case '{1 + 2} => '{0}
10+
case '{f($y)} => y
11+
case '{g($y, $z)} => '{$y * $z}
12+
case '{ ((a: Int) => 3)($y) } => y
13+
case '{ 1 + ($y: Int)} => y
14+
case '{ val a = 1 + ($y: Int); 3 } => y
15+
// currently gives an unreachable case warning
16+
// but only when used in conjunction with the others.
17+
// I believe this is because implicit arguments are not taken
18+
// into account when checking whether we have already seen an `unapply` before.
19+
case '{ val $y: Int = $z; 1 } => z
20+
// TODO do NOT support syntax this syntax
21+
case '{ ((`$y`: Int) => 1 + y + ($z: Int))(2) } => z
22+
// TODO support syntax this syntax
2323
// case '{ (($y: Int) => 1 + y + ($z: Int))(2) } => z
24+
case '{ Option(1) match { case Some($n) => $z } } => z
2425
case _ => '{1}
2526
}
2627
}

0 commit comments

Comments
 (0)