@@ -6,21 +6,22 @@ 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
- // 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
23
23
// case '{ (($y: Int) => 1 + y + ($z: Int))(2) } => z
24
+ case ' { Option (1 ) match { case Some ($n) => $z } } => z
24
25
case _ => ' {1 }
25
26
}
26
27
}
0 commit comments