From d23db881918b7916bfe5fbfd8fabd13466916495 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Fri, 12 May 2023 12:29:18 +0200 Subject: [PATCH] test: add in a regression test for #8742 There was also some other tests that were _very_ similar to this, so it seemed like the logical place to also just include this one instead of creating another file for it. Closes #8742 --- tests/neg-custom-args/fatal-warnings/i8711.check | 4 ++++ tests/neg-custom-args/fatal-warnings/i8711.scala | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/tests/neg-custom-args/fatal-warnings/i8711.check b/tests/neg-custom-args/fatal-warnings/i8711.check index 0035af0755d4..491d1678b5ac 100644 --- a/tests/neg-custom-args/fatal-warnings/i8711.check +++ b/tests/neg-custom-args/fatal-warnings/i8711.check @@ -6,3 +6,7 @@ 12 | case x: C => x // error | ^^^^ | Unreachable case +-- [E030] Match case Unreachable Error: tests/neg-custom-args/fatal-warnings/i8711.scala:17:9 -------------------------- +17 | case x: (B | C) => x // error + | ^^^^^^^^^^ + | Unreachable case diff --git a/tests/neg-custom-args/fatal-warnings/i8711.scala b/tests/neg-custom-args/fatal-warnings/i8711.scala index e37f7a8b039f..46fc5a85c90a 100644 --- a/tests/neg-custom-args/fatal-warnings/i8711.scala +++ b/tests/neg-custom-args/fatal-warnings/i8711.scala @@ -12,4 +12,9 @@ object Test { case x: C => x // error case _ => } + + def baz(x: A) = x match { + case x: (B | C) => x // error + case _ => + } }