|
1 |
| -import scala.quoted._, scala.deriving.* |
| 1 | +import scala.quoted._, scala.deriving.* // error |
| 2 | +// ^ |
| 3 | +// Match type reduction failed since selector ((2 : Int), quoted.Expr[(3 : Int)]) |
| 4 | +// matches none of the cases |
| 5 | +// |
| 6 | +// case quoted.Expr[x] *: t => x *: scala.Tuple.InverseMap[t, quoted.Expr] |
| 7 | +// case EmptyTuple => EmptyTuple |
| 8 | + |
| 9 | +inline def mcr: Any = ${mcrImpl} // error |
| 10 | +// ^ |
| 11 | +// Match type reduction failed since selector ((2 : Int), quoted.Expr[(3 : Int)]) |
| 12 | +// matches none of the cases |
| 13 | +// |
| 14 | +// case quoted.Expr[x] *: t => x *: scala.Tuple.InverseMap[t, quoted.Expr] |
| 15 | +// case EmptyTuple => EmptyTuple |
| 16 | + |
| 17 | +def mcrImpl(using ctx: Quotes): Expr[Any] = { // error // error |
| 18 | + //^ |
| 19 | + // Match type reduction failed since selector ((2 : Int), quoted.Expr[(3 : Int)]) |
| 20 | + // matches none of the cases |
| 21 | + // |
| 22 | + // case quoted.Expr[x] *: t => x *: scala.Tuple.InverseMap[t, quoted.Expr] |
| 23 | + // case EmptyTuple => EmptyTuple |
| 24 | + |
| 25 | + // ^ |
| 26 | + // Match type reduction failed since selector ((2 : Int), quoted.Expr[(3 : Int)]) |
| 27 | + // matches none of the cases |
| 28 | + // |
| 29 | + // case quoted.Expr[x] *: t => x *: scala.Tuple.InverseMap[t, quoted.Expr] |
| 30 | + // case EmptyTuple => EmptyTuple |
2 | 31 |
|
3 |
| -inline def mcr: Any = ${mcrImpl} |
4 |
| -def mcrImpl(using ctx: Quotes): Expr[Any] = { |
5 | 32 | val tpl: (Expr[1], Expr[2], Expr[3]) = ('{1}, '{2}, '{3})
|
6 | 33 | '{val res: (1, 3, 3) = ${Expr.ofTuple(tpl)}; res} // error
|
| 34 | + // ^^^^^^^^^^^^^^^^^ |
| 35 | + // Found: quoted.Expr[(1 : Int) *: (2 : Int) *: (3 : Int) *: EmptyTuple] |
| 36 | + // Required: quoted.Expr[((1 : Int), (3 : Int), (3 : Int))] |
7 | 37 |
|
8 | 38 | val tpl2: (Expr[1], 2, Expr[3]) = ('{1}, 2, '{3})
|
9 |
| - '{val res = ${Expr.ofTuple(tpl2)}; res} // error |
| 39 | + '{val res = ${Expr.ofTuple(tpl2)}; res} // error // error // error // error |
| 40 | + // ^ |
| 41 | + // Cannot prove that (quoted.Expr[(1 : Int)], (2 : Int), quoted.Expr[(3 : Int)]) =:= scala.Tuple.Map[ |
| 42 | + // scala.Tuple.InverseMap[ |
| 43 | + // (quoted.Expr[(1 : Int)], (2 : Int), quoted.Expr[(3 : Int)]) |
| 44 | + // , quoted.Expr] |
| 45 | + // , quoted.Expr]. |
| 46 | + |
| 47 | + // ^ |
| 48 | + // Match type reduction failed since selector ((2 : Int), quoted.Expr[(3 : Int)]) |
| 49 | + // matches none of the cases |
| 50 | + // |
| 51 | + // case quoted.Expr[x] *: t => x *: scala.Tuple.InverseMap[t, quoted.Expr] |
| 52 | + // case EmptyTuple => EmptyTuple |
| 53 | + |
| 54 | + // ^ |
| 55 | + // Cyclic reference involving val res |
| 56 | + |
| 57 | + // ^ |
| 58 | + // Match type reduction failed since selector ((2 : Int), quoted.Expr[(3 : Int)]) |
| 59 | + // matches none of the cases |
| 60 | + // |
| 61 | + // case quoted.Expr[x] *: t => x *: scala.Tuple.InverseMap[t, quoted.Expr] |
| 62 | + // case EmptyTuple => EmptyTuple |
10 | 63 | }
|
0 commit comments