Skip to content

Commit 97e77a6

Browse files
committed
Fix tests and add check files
1 parent bd43e99 commit 97e77a6

File tree

3 files changed

+540
-4
lines changed

3 files changed

+540
-4
lines changed

tests/neg/i12049.check

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,58 @@ longer explanation available when compiling with `-explain`
4848
| case EmptyTuple => EmptyTuple
4949

5050
longer explanation available when compiling with `-explain`
51+
-- Error: tests/neg/i12049.scala:24:20 ---------------------------------------------------------------------------------
52+
24 |val _ = summon[M[B]] // error
53+
| ^
54+
| no implicit argument of type M[B] was found for parameter x of method summon in object Predef
55+
|
56+
| Note: a match type could not be fully reduced:
57+
|
58+
| trying to reduce M[B]
59+
| failed since selector B
60+
| does not match case A => Int
61+
| and cannot be shown to be disjoint from it either.
62+
| Therefore, reduction cannot advance to the remaining case
63+
|
64+
| case B => String
65+
-- Error: tests/neg/i12049.scala:25:78 ---------------------------------------------------------------------------------
66+
25 |val _ = summon[String =:= Last[Int *: Int *: Boolean *: String *: EmptyTuple]] // error
67+
| ^
68+
| Cannot prove that String =:= Last[EmptyTuple.type].
69+
|
70+
| Note: a match type could not be fully reduced:
71+
|
72+
| trying to reduce Last[EmptyTuple.type]
73+
| failed since selector EmptyTuple.type
74+
| matches none of the cases
75+
|
76+
| case _ *: _ *: t => Last[t]
77+
| case t *: EmptyTuple => t
78+
-- Error: tests/neg/i12049.scala:26:48 ---------------------------------------------------------------------------------
79+
26 |val _ = summon[(A, B, A) =:= Reverse[(A, B, A)]] // error
80+
| ^
81+
| Cannot prove that (A, B, A) =:= Tuple.Concat[Reverse[A *: EmptyTuple.type], (B, A)].
82+
|
83+
| Note: a match type could not be fully reduced:
84+
|
85+
| trying to reduce Tuple.Concat[Reverse[A *: EmptyTuple.type], (B, A)]
86+
| trying to reduce Reverse[A *: EmptyTuple.type]
87+
| failed since selector A *: EmptyTuple.type
88+
| matches none of the cases
89+
|
90+
| case t1 *: t2 *: ts => Tuple.Concat[Reverse[ts], (t2, t1)]
91+
| case EmptyTuple => EmptyTuple
92+
-- [E008] Not Found Error: tests/neg/i12049.scala:28:21 ----------------------------------------------------------------
93+
28 |val _ = (??? : M[B]).length // error
94+
| ^^^^^^^^^^^^^^^^^^^
95+
| value length is not a member of M[B]
96+
|
97+
| Note: a match type could not be fully reduced:
98+
|
99+
| trying to reduce M[B]
100+
| failed since selector B
101+
| does not match case A => Int
102+
| and cannot be shown to be disjoint from it either.
103+
| Therefore, reduction cannot advance to the remaining case
104+
|
105+
| case B => String

tests/neg/i12049.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ val z1: (B, A) = ??? : Reverse[(A, B)]
2121
val z2: (B, A, B, A) = ??? : Reverse[(A, B, A, B)]
2222
val z3: (A, B, A) = ??? : Reverse[(A, B, A)] // error
2323

24-
val _ = summon[M[B]]
25-
val _ = summon[String =:= Last[Int *: Int *: Boolean *: String *: EmptyTuple]]
26-
val _ = summon[(A, B, A) =:= Reverse[(A, B, A)]]
24+
val _ = summon[M[B]] // error
25+
val _ = summon[String =:= Last[Int *: Int *: Boolean *: String *: EmptyTuple]] // error
26+
val _ = summon[(A, B, A) =:= Reverse[(A, B, A)]] // error
2727

28-
val _ = (??? : M[B]).length
28+
val _ = (??? : M[B]).length // error
2929

0 commit comments

Comments
 (0)