Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9299 from dwijnand/xlint-unsealed-match
Switch off exhaustivity warnings for unsealed types (by default)
- Loading branch information
Showing
28 changed files
with
21 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,13 @@ | ||
t11102.scala:2: warning: match may not be exhaustive. | ||
It would fail on the following input: (x: ImmutableSeq forSome x not in ImmutableCons) | ||
def f(x: ImmutableSeq) = x match { | ||
^ | ||
t11102.scala:5: warning: match may not be exhaustive. | ||
It would fail on the following input: (x: MutableSeq forSome x not in MutableCons) | ||
def f(x: MutableSeq) = x match { | ||
^ | ||
t11102.scala:5: error: error during expansion of this match (this is a scalac bug). | ||
The underlying error was: type mismatch; | ||
found : Seq[MutableCons] (in scala.collection.mutable) | ||
required: Seq[MutableCons] (in scala.collection.immutable) | ||
def f(x: MutableSeq) = x match { | ||
^ | ||
t11102.scala:8: warning: match may not be exhaustive. | ||
It would fail on the following input: (x: CollectionSeq forSome x not in CollectionCons) | ||
def f(x: CollectionSeq) = x match { | ||
^ | ||
t11102.scala:8: error: error during expansion of this match (this is a scalac bug). | ||
The underlying error was: type mismatch; | ||
found : Seq[CollectionCons] (in scala.collection) | ||
required: Seq[CollectionCons] (in scala.collection.immutable) | ||
def f(x: CollectionSeq) = x match { | ||
^ | ||
t11102.scala:11: warning: match may not be exhaustive. | ||
It would fail on the following input: (x: ScalaSeq forSome x not in ScalaCons) | ||
def f(x: ScalaSeq) = x match { | ||
^ | ||
t11102.scala:14: warning: match may not be exhaustive. | ||
It would fail on the following input: (x: DefaultSeq forSome x not in DefaultCons) | ||
def f(x: DefaultSeq) = x match { | ||
^ | ||
5 warnings | ||
2 errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
t11746.scala:16: warning: match may not be exhaustive. | ||
It would fail on the following input: (x: Try forSome x not in Failure) | ||
private def get(a: String): Unit = Try(a) match { | ||
^ | ||
t11746.scala:18: warning: failed to determine if e should be inlined: | ||
The method e()Ljava/lang/Throwable; could not be found in the class java/lang/Object or any of its parents. | ||
case Failure(e) => println(e.toString) | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
2 warnings | ||
1 warning | ||
1 error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
tailrec-4.scala:7: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
tailrec-4.scala:6: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
@tailrec def foo: Int = foo + 1 | ||
^ | ||
tailrec-4.scala:12: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
tailrec-4.scala:11: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
@tailrec def foo: Int = foo + 1 | ||
^ | ||
tailrec-4.scala:18: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
tailrec-4.scala:17: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
@tailrec def foo: Int = foo + 1 | ||
^ | ||
tailrec-4.scala:24: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
tailrec-4.scala:23: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
@tailrec def foo: Int = foo + 1 | ||
^ | ||
tailrec-4.scala:32: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
tailrec-4.scala:31: error: could not optimize @tailrec annotated method foo: it contains a recursive call not in tail position | ||
@tailrec def foo: Int = foo + 1 | ||
^ | ||
5 errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// scalac: -Xno-unsealed-patmat-analysis | ||
import annotation._ | ||
|
||
object Tail { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
virtpatmat_unreach_select.scala:12: warning: unreachable code | ||
case WARNING.id => // unreachable | ||
^ | ||
virtpatmat_unreach_select.scala:9: warning: match may not be exhaustive. | ||
It would fail on the following input: (x: Int forSome x not in (id, id)) | ||
(0: Int) match { | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
2 warnings | ||
1 warning | ||
1 error |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
matchonstream.scala:2: warning: match may not be exhaustive. | ||
LazyList.from(1) match { case LazyList(1, 2, x @_*) => println(s"It worked! (class: ${x.getClass.getSimpleName})") } | ||
^ | ||
It worked! (class: LazyList) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.