Skip to content

Commit 33354df

Browse files
Make Tuple.Filter tests more elaborate
1 parent 23758ae commit 33354df

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

compiler/test/dotc/pos-test-pickling.blacklist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ reference
1212
scala-days-2019-slides
1313
i7048e.scala
1414
i8052.scala
15+
tuple-filter.scala
1516

1617
# Stale symbol: package object scala
1718
seqtype-cycle

tests/neg/tuple-filter.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@ type P[x] <: Boolean = x match {
22
case 3 => false
33
case _ => true
44
}
5-
val tup: (1, 2, 3) = (1, 2, 3)
6-
val tup2: Tuple.Filter[(1, 2, 3, 4), P] = tup // error
5+
type RejectAll[x] = false
6+
7+
def Test =
8+
summon[Tuple.Filter[(1, 2, 3, 4), P] =:= EmptyTuple] // error
9+
summon[Tuple.Filter[(1, 2, 3, 4), RejectAll] =:= (1, 2, 3)] // error
10+
summon[Tuple.Filter[EmptyTuple, P] =:= (1, 2, 3)] // error

tests/pos/tuple-filter.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@ type P[x] <: Boolean = x match {
22
case 3 => false
33
case _ => true
44
}
5-
val tup: (1, 2, 4) = (1, 2, 4)
6-
val tup2: Tuple.Filter[(1, 2, 3, 4), P] = tup
5+
type RejectAll[x] = false
6+
7+
def Test =
8+
summon[Tuple.Filter[(1, 2, 3, 4), P] =:= (1, 2, 4)]
9+
summon[Tuple.Filter[(1, 2, 3, 4), RejectAll] =:= EmptyTuple]
10+
summon[Tuple.Filter[EmptyTuple, P] =:= EmptyTuple]

0 commit comments

Comments
 (0)