From 38ba1d53ae782cc3a7cdb3b4fef5db805bbdf497 Mon Sep 17 00:00:00 2001 From: Olivier Blanvillain Date: Wed, 29 Sep 2021 14:40:39 +0200 Subject: [PATCH] Fix #12944: Add regression test --- tests/pos/12944/12944_1.scala | 11 +++++++++++ tests/pos/12944/12944_2.scala | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 tests/pos/12944/12944_1.scala create mode 100644 tests/pos/12944/12944_2.scala diff --git a/tests/pos/12944/12944_1.scala b/tests/pos/12944/12944_1.scala new file mode 100644 index 000000000000..e6b6286c43a3 --- /dev/null +++ b/tests/pos/12944/12944_1.scala @@ -0,0 +1,11 @@ +object Test1 { + type ++[L, R] = (L, R) match + case (Int, Int) => 2 + case (String, String) => "2" + case (String, Int) => "2" + case (Int, String) => "2" + + type Bar[W <: Int] = W ++ "" ++ W + + val works = summon[Bar[2] =:= "2"] +} diff --git a/tests/pos/12944/12944_2.scala b/tests/pos/12944/12944_2.scala new file mode 100644 index 000000000000..cb471a59d191 --- /dev/null +++ b/tests/pos/12944/12944_2.scala @@ -0,0 +1,5 @@ +import Test1._ + +object Test2 { + val fails = summon[Bar[2] =:= "2"] +}