Skip to content

Commit dc9b965

Browse files
authored
Merge pull request #125 from SethTisue/exhausted
avoid new exhaustive match warnings in 2.13.4
2 parents 55b4c0e + d62ff02 commit dc9b965

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

core/src/main/scala/scala/collection/immutable/TrieIterator.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ private[collection] abstract class TrieIterator[+T](elems: Array[Iterable[T]]) e
4545
private[this] var posD = initPosD
4646
private[this] var subIter = initSubIter
4747

48-
private[this] def getElems(x: Iterable[T]): Array[Iterable[T]] = (x match {
48+
private[this] def getElems(x: Iterable[T]): Array[Iterable[T]] = ((x: @unchecked) match {
4949
case x: HashTrieMap[_, _] => x.elems
5050
case x: HashTrieSet[_] => x.elems
5151
}).asInstanceOf[Array[Iterable[T]]]
5252

53-
private[this] def collisionToArray(x: Iterable[T]): Array[Iterable[T]] = (x match {
53+
private[this] def collisionToArray(x: Iterable[T]): Array[Iterable[T]] = ((x: @unchecked) match {
5454
case x: OldHashMapCollision1[_, _] => x.kvs.map((x: (Any, Any)) => OldHashMap(x)).toArray
5555
case x: OldHashSetCollision1[_] => x.ks.map(x => OldHashSet(x)).toArray
5656
}).asInstanceOf[Array[Iterable[T]]]

core/src/main/scala/scala/collection/parallel/ParIterableLike.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ extends IterableOnce[T @uncheckedVariance]
13811381

13821382
protected[this] def scanBlockSize = (thresholdFromSize(size, tasksupport.parallelismLevel) / 2) max 1
13831383

1384-
protected[this] trait ScanTree[U >: T] {
1384+
protected[this] sealed trait ScanTree[U >: T] {
13851385
def beginsAt: Int
13861386
def pushdown(v: U): Unit
13871387
def leftmost: ScanLeaf[U]

core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ extends ParMap[K, V]
7979
override def size = {
8080
val in = ctrie.readRoot()
8181
val r = in.gcasRead(ctrie)
82-
r match {
82+
(r: @unchecked) match {
8383
case tn: TNode[_, _] => tn.cachedSize(ctrie)
8484
case ln: LNode[_, _] => ln.cachedSize(ctrie)
8585
case cn: CNode[_, _] =>
@@ -102,7 +102,7 @@ extends ParMap[K, V]
102102
var i = offset
103103
val until = offset + howmany
104104
while (i < until) {
105-
array(i) match {
105+
(array(i): @unchecked) match {
106106
case sn: SNode[_, _] => sz += 1
107107
case in: INode[K @unchecked, V @unchecked] => sz += in.cachedSize(ctrie)
108108
}

testmacros/src/main/scala-2/testutil/ShouldNotTypecheck.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ object ShouldNotTypecheck {
2929
def applyImpl(ctx: Context)(code: ctx.Expr[String], expected: ctx.Expr[String]): ctx.Expr[Unit] = {
3030
import ctx.universe._
3131

32-
val Expr(Literal(Constant(codeStr: String))) = code
33-
val (expPat, expMsg) = expected match {
32+
val Expr(Literal(Constant(codeStr: String))) = code: @unchecked
33+
val (expPat, expMsg) = (expected: @unchecked) match {
3434
case null => (null, "Expected some error.")
3535
case Expr(Literal(Constant(s: String))) =>
3636
(Pattern.compile(s, Pattern.CASE_INSENSITIVE | Pattern.DOTALL), "Expected error matching: "+s)

0 commit comments

Comments
 (0)