From 5c4493b65b00827f0486101216fee64120e3c732 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Fri, 12 May 2023 11:51:34 +0200 Subject: [PATCH] test: add in a regression test for #8300 Closes #8300 --- tests/pos/i8300.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/pos/i8300.scala diff --git a/tests/pos/i8300.scala b/tests/pos/i8300.scala new file mode 100644 index 000000000000..f106b24dbd1c --- /dev/null +++ b/tests/pos/i8300.scala @@ -0,0 +1,15 @@ +// https://github.com/lampepfl/dotty/issues/8300 + +type Bar[X] = X match { + case List[a] => List[Tuple1[a]] + case Set[a] => Set[Tuple1[a]] +} + +object Test: + (Set(1, 2, 3), List("a", "b")).map( + [A] => + (a: A) => + a match { + case it: Iterable[x] => it.map(Tuple1(_)).asInstanceOf[Bar[A]] + } + )