From 99327163ac943ac7bc7d8a0ed048491fcd74ccad Mon Sep 17 00:00:00 2001 From: Olivier Blanvillain Date: Thu, 27 May 2021 17:31:38 +0200 Subject: [PATCH] Fix #9623: Add regression test --- tests/pos/9623.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/pos/9623.scala diff --git a/tests/pos/9623.scala b/tests/pos/9623.scala new file mode 100644 index 000000000000..656afefb941e --- /dev/null +++ b/tests/pos/9623.scala @@ -0,0 +1,22 @@ +object A { + sealed trait TList + sealed trait TNil extends TList + sealed trait ++:[H, T <: TList] extends TList + + type :--[R <: TList, A] <: TList = R match { + case (A ++: t) => t + case (h ++: t) => h ++: (t :-- A) + } +} + +object B { + import A.* + + type X = (Int ++: String ++: Double ++: TNil) :-- String + + class T[A] + + def f(ta: T[X]) = () + + f(new T[Int ++: Double ++: TNil]) +}