Skip to content

Commit 89e80b9

Browse files
committed
Add tests of literals with elements of mmixed types
1 parent 6e904fb commit 89e80b9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/run/seqlits.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ object SeqLits:
4747
val hbs: HashMap[Int, Seq[BitSet]] = [1 -> [[1], [2, 3]], 2 -> [[]], 0 -> []]
4848
// val mbss: Map[BitSet, Seq[Int]] = [[1] -> [1], [0, 2] -> [1, 2], [0] -> []] // error: keys get default value Seq
4949
val mbss: Map[BitSet, Seq[Int]] = [([1], [1]), ([0, 2], [1, 2]), ([0], [])] // ok
50+
val mixed1 = [1, 1.0, -2]
51+
val _: Seq[Double] = mixed1
52+
val mixed2 = [1, true]
53+
val _: Seq[Int | Boolean] = mixed2
54+
val anInt = 3
55+
val mixed3 = [anInt, 3.0]
56+
val _: Seq[Int | Double] = mixed3
5057

5158
val x1 = f1(Vector(1, 2, 3), [3, 4, 5])
5259
val _: Seq[Int] = x1

0 commit comments

Comments
 (0)