File tree Expand file tree Collapse file tree 5 files changed +14
-10
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
neg-custom-args/fatal-warnings Expand file tree Collapse file tree 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 {
953953 if prev == Empty && covered == Empty then // defer until a case is reachable
954954 deferred ::= pat
955955 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)
958959 if pat != EmptyTree // rethrow case of catch uses EmptyTree
959960 && isSubspace(covered, prev)
960961 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 ------------------------------ ---------------------------
227 | 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 ------------------------------ --------------------------
6612 | 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
2116: Match case Unreachable
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ sealed trait Foo
88class Bar
99
1010def test1 (bar : Bar ) = bar match
11- case _ : Foo => 1
11+ case _ : Foo => 1 // FIXME: this is unreachable, but reverted for i13931
1212 case _ : Bar => 2
1313
1414def 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