@@ -6,22 +6,25 @@ object Test {
6
6
def g (x : Int , y : Int ) = x * y
7
7
8
8
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
- // TODO do NOT support syntax this syntax
21
- case ' { ((`$y` : Int ) => 1 + y + ($z : Int ))(2 ) } => z
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
22
// TODO support syntax this syntax
23
23
// case '{ (($y: Int) => 1 + y + ($z: Int))(2) } => z
24
- case ' { Option (1 ) match { case Some ($n) => $z } } => z
24
+ // case '{ Option(1) match { case Some($n) => $z } } => z
25
+ case ' { Option (1 ) match { case $a @ Some ($n) => $z } } => z
26
+ case ' { Option (1 ) match { case $b : Some [_] => $z } } => z
27
+ case ' { Option (1 ) match { case $c => $z } } => z
25
28
case _ => ' {1 }
26
29
}
27
30
}
0 commit comments