We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a8274c commit 3340ba6Copy full SHA for 3340ba6
tests/patmat/i13485.check
@@ -0,0 +1 @@
1
+16: Match case Unreachable
tests/patmat/i13485.scala
@@ -0,0 +1,16 @@
+// The intent of this test is test that changing the order of cases doesn't affect whether
2
+// warnings, originally reachability warnings but exhaustivity warnings too, are emitted.
3
+// To do so we need a case that typechecks but is statically assessed to be unreachable.
4
+// How about... a type pattern on a sealed trait that the scrutinee type doesn't extend?
5
+
6
+sealed trait Foo
7
8
+class Bar
9
10
+def test1(bar: Bar) = bar match
11
+ case _: Foo => 1
12
+ case _: Bar => 2
13
14
+def test2(bar: Bar) = bar match
15
16
0 commit comments