From d52b3656e4caca7591d5e5223caf9055bc57780f Mon Sep 17 00:00:00 2001 From: Olivier Blanvillain Date: Fri, 11 Jun 2021 11:32:03 +0200 Subject: [PATCH] Add test case --- tests/neg/12549.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/neg/12549.scala diff --git a/tests/neg/12549.scala b/tests/neg/12549.scala new file mode 100644 index 000000000000..4e2a5531efa0 --- /dev/null +++ b/tests/neg/12549.scala @@ -0,0 +1,18 @@ +enum Bool { + case True + case False +} + +import Bool.* + +type Not[B <: Bool] = B match { + case True.type => False.type + case False.type => True.type + case _ => "unreachable" +} + +def foo[B <: Bool & Singleton]: Unit = { + implicitly[Not[B] =:= "unreachable"] // error + + () +}