From 226d908310ae17124317db3cc947ae55819c5e18 Mon Sep 17 00:00:00 2001 From: Olivier Blanvillain Date: Fri, 30 Apr 2021 11:24:06 +0200 Subject: [PATCH] Fix #8649: Add regression test It looks like this bug got fixed in #11704! --- .../test/dotc/pos-test-pickling.blacklist | 1 + tests/pos/8649.scala | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/pos/8649.scala diff --git a/compiler/test/dotc/pos-test-pickling.blacklist b/compiler/test/dotc/pos-test-pickling.blacklist index 423c429d19e0..a9028e2bc25c 100644 --- a/compiler/test/dotc/pos-test-pickling.blacklist +++ b/compiler/test/dotc/pos-test-pickling.blacklist @@ -37,6 +37,7 @@ i11247.scala i11250 i9999.scala i12127.scala +8649.scala # Opaque type i5720.scala diff --git a/tests/pos/8649.scala b/tests/pos/8649.scala new file mode 100644 index 000000000000..7e0351d52628 --- /dev/null +++ b/tests/pos/8649.scala @@ -0,0 +1,32 @@ +// This is crazy: +type Get0 = OK[Int, Unit] +def get0: Handler[Get0] = IO[Unit]() + +case class HandlerAlt[A](value: Handler[A]) + +type Handler[API] = handler.Go[API] + +case class IO[A]() +case class OK[A, B]() + +object handler: + // Starter for Handler reduction: + type Go[API] = API match + case _ => + HandlerSingle[API] + + type HandlerSingle[X] = X match + case OK[_, response] => + IO[response] + +object Minimized { + case class HandlerAlt[A](value: M2[A]) + + type M1[X] = X match { + case _ => M2[X] + } + + type M2[X] = X match { + case Int => String + } +}