File tree 5 files changed +14
-10
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
neg-custom-args/fatal-warnings
5 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -953,8 +953,9 @@ class SpaceEngine(using Context) extends SpaceLogic {
953
953
if prev == Empty && covered == Empty then // defer until a case is reachable
954
954
deferred ::= pat
955
955
else {
956
- for (pat <- deferred.reverseIterator)
957
- report.warning(MatchCaseUnreachable (), pat.srcPos)
956
+ // FIXME: These should be emitted, but reverted for i13931
957
+ // for (pat <- deferred.reverseIterator)
958
+ // report.warning(MatchCaseUnreachable(), pat.srcPos)
958
959
if pat != EmptyTree // rethrow case of catch uses EmptyTree
959
960
&& isSubspace(covered, prev)
960
961
then {
Original file line number Diff line number Diff line change 1
- -- [E030] Match case Unreachable Error: tests/neg-custom-args/fatal-warnings/i8711.scala:7:9 ---------------------------
1
+ -- Error: tests/neg-custom-args/fatal-warnings/i8711.scala:7:9 ------------------------------ ---------------------------
2
2
7 | case x: B => x // error: this case is unreachable since class A is not a subclass of class B
3
- | ^^^^
4
- | Unreachable case
5
- -- [E030] Match case Unreachable Error: tests/neg-custom-args/fatal-warnings/i8711.scala:12:9 --------------------------
3
+ | ^
4
+ | this case is unreachable since type A and class B are unrelated
5
+ -- Error: tests/neg-custom-args/fatal-warnings/i8711.scala:12:9 ------------------------------ --------------------------
6
6
12 | case x: C => x // error
7
- | ^^^^
8
- | Unreachable case
7
+ | ^
8
+ | this case is unreachable since type A | B and class C are unrelated
Original file line number Diff line number Diff line change 1
- 11: Match case Unreachable
2
1
16: Match case Unreachable
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ sealed trait Foo
8
8
class Bar
9
9
10
10
def test1 (bar : Bar ) = bar match
11
- case _ : Foo => 1
11
+ case _ : Foo => 1 // FIXME: this is unreachable, but reverted for i13931
12
12
case _ : Bar => 2
13
13
14
14
def test2 (bar : Bar ) = bar match
Original file line number Diff line number Diff line change
1
+ class Test :
2
+ def test = Vector () match
3
+ case Seq () => println(" empty" )
4
+ case _ => println(" non-empty" )
You can’t perform that action at this time.
0 commit comments