From 33e71b3943f53f1c24fe889eb8411503e139379a Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Mon, 15 May 2023 14:49:21 +0200 Subject: [PATCH] test: add in a regression test for #14642 [skip community_build] closes #14642 --- tests/pos/i14642.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/pos/i14642.scala diff --git a/tests/pos/i14642.scala b/tests/pos/i14642.scala new file mode 100644 index 000000000000..b69da7d8d6d7 --- /dev/null +++ b/tests/pos/i14642.scala @@ -0,0 +1,16 @@ +// https://github.com/lampepfl/dotty/issues/14642 +case object A +case class B() +case class C() +type Union = A.type | B | C +val a: List[A.type] = ??? +val b: List[B] = ??? +val c: List[C] = ??? +val l1: List[Union] = a ++ b +val l2: List[Union] = + a ++ b ++ c +val l3: List[Union] = + (a: List[ + Union + ]) ++ b ++ c +val l4: List[Union] = (a: List[Union]) ++ (b ++ c)