Skip to content

Commit 44477ac

Browse files
Update neg test error annotations
1 parent 6b79b72 commit 44477ac

File tree

1 file changed

+57
-4
lines changed

1 file changed

+57
-4
lines changed

tests/neg-macros/toexproftuple.scala

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,63 @@
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
231

3-
inline def mcr: Any = ${mcrImpl}
4-
def mcrImpl(using ctx: Quotes): Expr[Any] = {
532
val tpl: (Expr[1], Expr[2], Expr[3]) = ('{1}, '{2}, '{3})
633
'{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))]
737

838
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
1063
}

0 commit comments

Comments
 (0)