From 712faecb84696c669003e3e8b0bb5c9fdc389b02 Mon Sep 17 00:00:00 2001 From: Filippo Mariotti Date: Thu, 30 Jul 2020 17:53:35 +0100 Subject: [PATCH] Scala 2.12.3 and 2.12.12 --- .travis.yml | 4 ++-- .../compat/IterableEmptyInstance.scala | 2 +- .../src/main/scala/alleycats/std/map.scala | 2 +- .../src/main/scala/alleycats/std/set.scala | 4 ++-- .../test/scala/alleycats/tests/MapSuite.scala | 2 +- .../cats/data/OneAndLowPriority4.scala | 2 +- .../cats/data/NonEmptyLazyList.scala | 10 ++++---- .../cats/data/OneAndLowPriority4.scala | 4 ++-- .../scala-2.13+/cats/instances/arraySeq.scala | 2 +- .../scala-2.13+/cats/instances/lazyList.scala | 2 +- core/src/main/scala/cats/Foldable.scala | 8 +++---- core/src/main/scala/cats/data/Chain.scala | 24 +++++++++---------- .../main/scala/cats/data/NonEmptyChain.scala | 16 ++++++------- .../main/scala/cats/data/NonEmptyList.scala | 6 ++--- .../main/scala/cats/data/NonEmptyVector.scala | 4 ++-- core/src/main/scala/cats/instances/list.scala | 2 +- core/src/main/scala/cats/instances/map.scala | 2 +- .../src/main/scala/cats/instances/queue.scala | 6 ++--- .../main/scala/cats/instances/sortedMap.scala | 4 ++-- .../main/scala/cats/instances/sortedSet.scala | 4 ++-- .../main/scala/cats/instances/vector.scala | 4 ++-- .../cats/kernel/instances/MapInstances.scala | 2 +- .../cats/kernel/instances/StaticMethods.scala | 14 +++++------ .../laws/discipline/ExhaustiveCheck.scala | 2 +- .../test/scala/cats/tests/ChainSuite.scala | 8 +++---- 25 files changed, 70 insertions(+), 70 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1542878e8a..c4971175a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,8 @@ jdk: - openjdk8 -scala_version_212: &scala_version_212 2.12.11 -scala_version_213: &scala_version_213 2.13.2 +scala_version_212: &scala_version_212 2.12.12 +scala_version_213: &scala_version_213 2.13.3 dotty_version: &dotty_version 0.24.0 before_install: diff --git a/alleycats-core/src/main/scala-2.13+/alleycats/compat/IterableEmptyInstance.scala b/alleycats-core/src/main/scala-2.13+/alleycats/compat/IterableEmptyInstance.scala index fa2c84558a..45350dde5b 100644 --- a/alleycats-core/src/main/scala-2.13+/alleycats/compat/IterableEmptyInstance.scala +++ b/alleycats-core/src/main/scala-2.13+/alleycats/compat/IterableEmptyInstance.scala @@ -5,5 +5,5 @@ import collection.Factory abstract class IterableEmptyInstance { implicit def iterableIsEmpty[CC[X] <: Iterable[X], A](implicit factory: Factory[A, CC[A]]): Empty[CC[A]] = - Empty(factory.newBuilder.result) + Empty(factory.newBuilder.result()) } diff --git a/alleycats-core/src/main/scala/alleycats/std/map.scala b/alleycats-core/src/main/scala/alleycats/std/map.scala index ee8e545ce0..4c3247965a 100644 --- a/alleycats-core/src/main/scala/alleycats/std/map.scala +++ b/alleycats-core/src/main/scala/alleycats/std/map.scala @@ -35,7 +35,7 @@ trait MapInstances { else { val n = idx.toInt if (n >= fa.size) None - else Some(fa.valuesIterator.drop(n).next) + else Some(fa.valuesIterator.drop(n).next()) } override def isEmpty[A](fa: Map[K, A]): Boolean = fa.isEmpty diff --git a/alleycats-core/src/main/scala/alleycats/std/set.scala b/alleycats-core/src/main/scala/alleycats/std/set.scala index e45d00e6e5..4860d1052e 100644 --- a/alleycats-core/src/main/scala/alleycats/std/set.scala +++ b/alleycats-core/src/main/scala/alleycats/std/set.scala @@ -91,9 +91,9 @@ trait SetInstances { @tailrec def go(idx: Int, it: Iterator[A]): Option[A] = if (it.hasNext) { - if (idx == 0) Some(it.next) + if (idx == 0) Some(it.next()) else { - it.next + it.next() go(idx - 1, it) } } else None diff --git a/alleycats-tests/shared/src/test/scala/alleycats/tests/MapSuite.scala b/alleycats-tests/shared/src/test/scala/alleycats/tests/MapSuite.scala index f53217f994..6ae59faa72 100644 --- a/alleycats-tests/shared/src/test/scala/alleycats/tests/MapSuite.scala +++ b/alleycats-tests/shared/src/test/scala/alleycats/tests/MapSuite.scala @@ -16,7 +16,7 @@ class MapSuite extends AlleycatsSuite { val items = Map((0 until 100000).map { i => (i.toString, i) }: _*) val sumAll = Traverse[Map[String, *]] .traverse(items) { i => () => i } - .apply + .apply() .values .sum diff --git a/core/src/main/scala-2.12/cats/data/OneAndLowPriority4.scala b/core/src/main/scala-2.12/cats/data/OneAndLowPriority4.scala index 084253818d..4c5f6613d0 100644 --- a/core/src/main/scala-2.12/cats/data/OneAndLowPriority4.scala +++ b/core/src/main/scala-2.12/cats/data/OneAndLowPriority4.scala @@ -9,7 +9,7 @@ abstract private[data] class OneAndLowPriority4 { new Comonad[OneAnd[Stream, *]] { def coflatMap[A, B](fa: OneAnd[Stream, A])(f: OneAnd[Stream, A] => B): OneAnd[Stream, B] = { @tailrec def consume(as: Stream[A], buf: Builder[B, Stream[B]]): Stream[B] = - if (as.isEmpty) buf.result + if (as.isEmpty) buf.result() else { val tail = as.tail consume(tail, buf += f(OneAnd(as.head, tail))) diff --git a/core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala b/core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala index 9e1c0f1942..2ff81ceb0e 100644 --- a/core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala +++ b/core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala @@ -264,8 +264,8 @@ class NonEmptyLazyListOps[A](private val value: NonEmptyLazyList[A]) */ final def reduceLeftTo[B](f: A => B)(g: (B, A) => B): B = { val iter = toLazyList.iterator - var result = f(iter.next) - while (iter.hasNext) { result = g(result, iter.next) } + var result = f(iter.next()) + while (iter.hasNext) { result = g(result, iter.next()) } result } @@ -281,8 +281,8 @@ class NonEmptyLazyListOps[A](private val value: NonEmptyLazyList[A]) */ final def reduceRightTo[B](f: A => B)(g: (A, B) => B): B = { val iter = toLazyList.reverseIterator - var result = f(iter.next) - while (iter.hasNext) { result = g(iter.next, result) } + var result = f(iter.next()) + while (iter.hasNext) { result = g(iter.next(), result) } result } @@ -395,7 +395,7 @@ class NonEmptyLazyListOps[A](private val value: NonEmptyLazyList[A]) } m.map { - case (k, v) => (k, create(v.result)) + case (k, v) => (k, create(v.result())) }: TreeMap[B, NonEmptyLazyList[A]] } diff --git a/core/src/main/scala-2.13+/cats/data/OneAndLowPriority4.scala b/core/src/main/scala-2.13+/cats/data/OneAndLowPriority4.scala index 90ad878889..3f08c7bdd8 100644 --- a/core/src/main/scala-2.13+/cats/data/OneAndLowPriority4.scala +++ b/core/src/main/scala-2.13+/cats/data/OneAndLowPriority4.scala @@ -10,7 +10,7 @@ abstract private[data] class OneAndLowPriority4 { new Comonad[OneAnd[Stream, *]] { def coflatMap[A, B](fa: OneAnd[Stream, A])(f: OneAnd[Stream, A] => B): OneAnd[Stream, B] = { @tailrec def consume(as: Stream[A], buf: Builder[B, Stream[B]]): Stream[B] = - if (as.isEmpty) buf.result + if (as.isEmpty) buf.result() else { val tail = as.tail consume(tail, buf += f(OneAnd(as.head, tail))) @@ -29,7 +29,7 @@ abstract private[data] class OneAndLowPriority4 { new Comonad[OneAnd[LazyList, *]] { def coflatMap[A, B](fa: OneAnd[LazyList, A])(f: OneAnd[LazyList, A] => B): OneAnd[LazyList, B] = { @tailrec def consume(as: LazyList[A], buf: Builder[B, LazyList[B]]): LazyList[B] = - if (as.isEmpty) buf.result + if (as.isEmpty) buf.result() else { val tail = as.tail consume(tail, buf += f(OneAnd(as.head, tail))) diff --git a/core/src/main/scala-2.13+/cats/instances/arraySeq.scala b/core/src/main/scala-2.13+/cats/instances/arraySeq.scala index d1bedcf30d..18504c1f13 100644 --- a/core/src/main/scala-2.13+/cats/instances/arraySeq.scala +++ b/core/src/main/scala-2.13+/cats/instances/arraySeq.scala @@ -100,7 +100,7 @@ private[cats] object ArraySeqInstances { case h :: tail if h.isEmpty => loop(state = tail) case h :: tail => - h.next match { + h.next() match { case Right(b) => buf += b loop(state) diff --git a/core/src/main/scala-2.13+/cats/instances/lazyList.scala b/core/src/main/scala-2.13+/cats/instances/lazyList.scala index 5cd5019ae5..ac5928865b 100644 --- a/core/src/main/scala-2.13+/cats/instances/lazyList.scala +++ b/core/src/main/scala-2.13+/cats/instances/lazyList.scala @@ -72,7 +72,7 @@ trait LazyListInstances extends cats.kernel.instances.LazyListInstances { val kernel = Iterator.unfold[Option[B], Iterator[Either[A, B]]](Iterator(Left(a))) { it => if (!it.hasNext) None else - it.next match { + it.next() match { case Left(a) => Some((None, fn(a).iterator ++ it)) case Right(b) => Some((Some(b), it)) } diff --git a/core/src/main/scala/cats/Foldable.scala b/core/src/main/scala/cats/Foldable.scala index 651a23346d..9d2e1e10d9 100644 --- a/core/src/main/scala/cats/Foldable.scala +++ b/core/src/main/scala/cats/Foldable.scala @@ -774,13 +774,13 @@ import scala.annotation.implicitNotFound val bld = List.newBuilder[A] val it = xs.iterator if (it.hasNext) { - bld += it.next + bld += it.next() while (it.hasNext) { bld += x - bld += it.next + bld += it.next() } } - bld.result + bld.result() } def compose[G[_]: Foldable]: Foldable[λ[α => F[G[α]]]] = @@ -879,7 +879,7 @@ object Foldable { def iterateRight[A, B](iterable: Iterable[A], lb: Eval[B])(f: (A, Eval[B]) => Eval[B]): Eval[B] = { def loop(it: Iterator[A]): Eval[B] = - Eval.defer(if (it.hasNext) f(it.next, loop(it)) else lb) + Eval.defer(if (it.hasNext) f(it.next(), loop(it)) else lb) Eval.always(iterable.iterator).flatMap(loop) } diff --git a/core/src/main/scala/cats/data/Chain.scala b/core/src/main/scala/cats/data/Chain.scala index 27be286523..796977c634 100644 --- a/core/src/main/scala/cats/data/Chain.scala +++ b/core/src/main/scala/cats/data/Chain.scala @@ -148,7 +148,7 @@ sealed abstract class Chain[+A] { final def flatMap[B](f: A => Chain[B]): Chain[B] = { var result = empty[B] val iter = iterator - while (iter.hasNext) { result = result ++ f(iter.next) } + while (iter.hasNext) { result = result ++ f(iter.next()) } result } @@ -158,7 +158,7 @@ sealed abstract class Chain[+A] { final def foldLeft[B](z: B)(f: (B, A) => B): B = { var result = z val iter = iterator - while (iter.hasNext) { result = f(result, iter.next) } + while (iter.hasNext) { result = f(result, iter.next()) } result } @@ -202,7 +202,7 @@ sealed abstract class Chain[+A] { final def foldRight[B](z: B)(f: (A, B) => B): B = { var result = z val iter = reverseIterator - while (iter.hasNext) { result = f(iter.next, result) } + while (iter.hasNext) { result = f(iter.next(), result) } result } @@ -347,7 +347,7 @@ sealed abstract class Chain[+A] { val iter = iterator while (iter.hasNext) { - val elem = iter.next + val elem = iter.next() val k = f(elem) m.get(k) match { @@ -411,7 +411,7 @@ sealed abstract class Chain[+A] { case Wrap(seq) => val iterator = seq.iterator while (iterator.hasNext) { - val b = f(iterator.next) + val b = f(iterator.next()) if (b) return () } c = @@ -444,7 +444,7 @@ sealed abstract class Chain[+A] { final def length: Long = { val iter = iterator var i: Long = 0 - while (iter.hasNext) { i += 1; iter.next; } + while (iter.hasNext) { i += 1; iter.next(); } i } @@ -479,7 +479,7 @@ sealed abstract class Chain[+A] { val iterY = that.iterator while (iterX.hasNext && iterY.hasNext) { // scalastyle:off return - if (!A.eqv(iterX.next, iterY.next)) return false + if (!A.eqv(iterX.next(), iterY.next())) return false // scalastyle:on return } @@ -515,7 +515,7 @@ sealed abstract class Chain[+A] { () } builder += ')' - builder.result + builder.result() } def hash[AA >: A](implicit hashA: Hash[AA]): Int = StaticMethods.orderedHash((this: Chain[AA]).iterator) @@ -761,7 +761,7 @@ object Chain extends ChainInstances { else rights.reduceLeft((x, y) => Append(y, x)) rights.clear() currentIterator = seq.iterator - currentIterator.next + currentIterator.next() case null | Empty => throw new java.util.NoSuchElementException("next called on empty iterator") } @@ -804,7 +804,7 @@ object Chain extends ChainInstances { else lefts.reduceLeft((x, y) => Append(x, y)) lefts.clear() currentIterator = seq.reverseIterator - currentIterator.next + currentIterator.next() case null | Empty => throw new java.util.NoSuchElementException("next called on empty iterator") } @@ -936,7 +936,7 @@ sealed abstract private[data] class ChainInstances extends ChainInstances1 { val iterX = x.iterator val iterY = y.iterator while (iterX.hasNext && iterY.hasNext) { - val n = A0.compare(iterX.next, iterY.next) + val n = A0.compare(iterX.next(), iterY.next()) // scalastyle:off return if (n != 0) return n // scalastyle:on return @@ -1006,7 +1006,7 @@ private[data] trait ChainPartialOrder[A] extends PartialOrder[Chain[A]] { val iterX = x.iterator val iterY = y.iterator while (iterX.hasNext && iterY.hasNext) { - val n = A.partialCompare(iterX.next, iterY.next) + val n = A.partialCompare(iterX.next(), iterY.next()) // scalastyle:off return if (n != 0.0) return n // scalastyle:on return diff --git a/core/src/main/scala/cats/data/NonEmptyChain.scala b/core/src/main/scala/cats/data/NonEmptyChain.scala index c0752b8df5..7a5c235921 100644 --- a/core/src/main/scala/cats/data/NonEmptyChain.scala +++ b/core/src/main/scala/cats/data/NonEmptyChain.scala @@ -285,8 +285,8 @@ class NonEmptyChainOps[A](private val value: NonEmptyChain[A]) */ final def reduceLeft(f: (A, A) => A): A = { val iter = toChain.iterator - var result = iter.next - while (iter.hasNext) { result = f(result, iter.next) } + var result = iter.next() + while (iter.hasNext) { result = f(result, iter.next()) } result } @@ -302,8 +302,8 @@ class NonEmptyChainOps[A](private val value: NonEmptyChain[A]) */ final def reduceLeftTo[B](f: A => B)(g: (B, A) => B): B = { val iter = toChain.iterator - var result = f(iter.next) - while (iter.hasNext) { result = g(result, iter.next) } + var result = f(iter.next()) + while (iter.hasNext) { result = g(result, iter.next()) } result } @@ -318,8 +318,8 @@ class NonEmptyChainOps[A](private val value: NonEmptyChain[A]) */ final def reduceRight(f: (A, A) => A): A = { val iter = toChain.reverseIterator - var result = iter.next - while (iter.hasNext) { result = f(result, iter.next) } + var result = iter.next() + while (iter.hasNext) { result = f(result, iter.next()) } result } @@ -335,8 +335,8 @@ class NonEmptyChainOps[A](private val value: NonEmptyChain[A]) */ final def reduceRightTo[B](f: A => B)(g: (A, B) => B): B = { val iter = toChain.reverseIterator - var result = f(iter.next) - while (iter.hasNext) { result = g(iter.next, result) } + var result = f(iter.next()) + while (iter.hasNext) { result = g(iter.next(), result) } result } diff --git a/core/src/main/scala/cats/data/NonEmptyList.scala b/core/src/main/scala/cats/data/NonEmptyList.scala index 4272a5b79d..ffaf88ee3e 100644 --- a/core/src/main/scala/cats/data/NonEmptyList.scala +++ b/core/src/main/scala/cats/data/NonEmptyList.scala @@ -325,10 +325,10 @@ final case class NonEmptyList[+A](head: A, tail: List[A]) extends NonEmptyCollec var idx = 1 val it = tail.iterator while (it.hasNext) { - bldr += ((it.next, idx)) + bldr += ((it.next(), idx)) idx += 1 } - NonEmptyList((head, 0), bldr.result) + NonEmptyList((head, 0), bldr.result()) } /** @@ -390,7 +390,7 @@ final case class NonEmptyList[+A](head: A, tail: List[A]) extends NonEmptyCollec } m.map { - case (k, v) => (k, NonEmptyList.fromListUnsafe(v.result)) + case (k, v) => (k, NonEmptyList.fromListUnsafe(v.result())) }: TreeMap[B, NonEmptyList[A]] } diff --git a/core/src/main/scala/cats/data/NonEmptyVector.scala b/core/src/main/scala/cats/data/NonEmptyVector.scala index 3c1211d5df..3ddefd7d7d 100644 --- a/core/src/main/scala/cats/data/NonEmptyVector.scala +++ b/core/src/main/scala/cats/data/NonEmptyVector.scala @@ -279,7 +279,7 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) } m.map { - case (k, v) => (k, NonEmptyVector.fromVectorUnsafe(v.result)) + case (k, v) => (k, NonEmptyVector.fromVectorUnsafe(v.result())) }: TreeMap[B, NonEmptyVector[A]] } @@ -507,7 +507,7 @@ object NonEmptyVector extends NonEmptyVectorInstances with Serializable { val buf = Vector.newBuilder[A] buf += head tail.foreach(buf += _) - new NonEmptyVector(buf.result) + new NonEmptyVector(buf.result()) } def one[A](head: A): NonEmptyVector[A] = apply(head, Vector.empty[A]) diff --git a/core/src/main/scala/cats/instances/list.scala b/core/src/main/scala/cats/instances/list.scala index ce4cba474a..6ba6a0bfd5 100644 --- a/core/src/main/scala/cats/instances/list.scala +++ b/core/src/main/scala/cats/instances/list.scala @@ -49,7 +49,7 @@ trait ListInstances extends cats.kernel.instances.ListInstances { case Nil => () } go(f(a) :: Nil) - buf.result + buf.result() } def coflatMap[A, B](fa: List[A])(f: List[A] => B): List[B] = { diff --git a/core/src/main/scala/cats/instances/map.scala b/core/src/main/scala/cats/instances/map.scala index ed60091ae4..bda0ab0f67 100644 --- a/core/src/main/scala/cats/instances/map.scala +++ b/core/src/main/scala/cats/instances/map.scala @@ -78,7 +78,7 @@ trait MapInstances extends cats.kernel.instances.MapInstances { } f(a).foreach { case (k, a) => descend(k, a) } - bldr.result + bldr.result() } override def isEmpty[A](fa: Map[K, A]): Boolean = fa.isEmpty diff --git a/core/src/main/scala/cats/instances/queue.scala b/core/src/main/scala/cats/instances/queue.scala index c75761d252..a901b49363 100644 --- a/core/src/main/scala/cats/instances/queue.scala +++ b/core/src/main/scala/cats/instances/queue.scala @@ -46,7 +46,7 @@ trait QueueInstances extends cats.kernel.instances.QueueInstances { } } case Nil => - bldr.result + bldr.result() } go(f(a) :: Nil) } @@ -54,7 +54,7 @@ trait QueueInstances extends cats.kernel.instances.QueueInstances { def coflatMap[A, B](fa: Queue[A])(f: Queue[A] => B): Queue[B] = { val bldr = Queue.newBuilder[B] @tailrec def loop(as: Queue[A]): Queue[B] = - if (as.isEmpty) bldr.result + if (as.isEmpty) bldr.result() else { val (_, rest) = as.dequeue bldr += f(as) @@ -89,7 +89,7 @@ trait QueueInstances extends cats.kernel.instances.QueueInstances { override def mapWithIndex[A, B](fa: Queue[A])(f: (A, Int) => B): Queue[B] = { val b = Queue.newBuilder[B] fa.iterator.zipWithIndex.map(ai => f(ai._1, ai._2)).foreach(b += _) - b.result + b.result() } override def zipWithIndex[A](fa: Queue[A]): Queue[(A, Int)] = diff --git a/core/src/main/scala/cats/instances/sortedMap.scala b/core/src/main/scala/cats/instances/sortedMap.scala index 6d24ccf8d8..39a45d9677 100644 --- a/core/src/main/scala/cats/instances/sortedMap.scala +++ b/core/src/main/scala/cats/instances/sortedMap.scala @@ -91,7 +91,7 @@ trait SortedMapInstances extends SortedMapInstances2 { } fa.foreach { case (k, a) => descend(k, a) } - bldr.result + bldr.result() } override def size[A](fa: SortedMap[K, A]): Long = fa.size.toLong @@ -101,7 +101,7 @@ trait SortedMapInstances extends SortedMapInstances2 { else { val n = idx.toInt if (n >= fa.size) None - else Some(fa.valuesIterator.drop(n).next) + else Some(fa.valuesIterator.drop(n).next()) } override def isEmpty[A](fa: SortedMap[K, A]): Boolean = fa.isEmpty diff --git a/core/src/main/scala/cats/instances/sortedSet.scala b/core/src/main/scala/cats/instances/sortedSet.scala index e829be16d4..377ed5a4f8 100644 --- a/core/src/main/scala/cats/instances/sortedSet.scala +++ b/core/src/main/scala/cats/instances/sortedSet.scala @@ -25,9 +25,9 @@ trait SortedSetInstances extends SortedSetInstances1 { @tailrec def go(idx: Int, it: Iterator[A]): Option[A] = if (it.hasNext) { - if (idx == 0) Some(it.next) + if (idx == 0) Some(it.next()) else { - it.next + it.next() go(idx - 1, it) } } else None diff --git a/core/src/main/scala/cats/instances/vector.scala b/core/src/main/scala/cats/instances/vector.scala index 2b8d6fac06..215e4734ff 100644 --- a/core/src/main/scala/cats/instances/vector.scala +++ b/core/src/main/scala/cats/instances/vector.scala @@ -68,7 +68,7 @@ trait VectorInstances extends cats.kernel.instances.VectorInstances { state = tail loop() case h :: tail => - h.next match { + h.next() match { case Right(b) => buf += b loop() @@ -78,7 +78,7 @@ trait VectorInstances extends cats.kernel.instances.VectorInstances { } } loop() - buf.result + buf.result() } override def size[A](fa: Vector[A]): Long = fa.size.toLong diff --git a/kernel/src/main/scala/cats/kernel/instances/MapInstances.scala b/kernel/src/main/scala/cats/kernel/instances/MapInstances.scala index 0de1f6ff8f..fe92f86b22 100644 --- a/kernel/src/main/scala/cats/kernel/instances/MapInstances.scala +++ b/kernel/src/main/scala/cats/kernel/instances/MapInstances.scala @@ -79,7 +79,7 @@ class MapMonoid[K, V](implicit V: Semigroup[V]) extends Monoid[Map[K, V]] { xss.iterator.foreach { m => val it = m.iterator while (it.hasNext) { - val (k, v) = it.next + val (k, v) = it.next() acc(k) = Semigroup.maybeCombine(acc.get(k), v) } } diff --git a/kernel/src/main/scala/cats/kernel/instances/StaticMethods.scala b/kernel/src/main/scala/cats/kernel/instances/StaticMethods.scala index 7edba34c1c..8f0e167c45 100644 --- a/kernel/src/main/scala/cats/kernel/instances/StaticMethods.scala +++ b/kernel/src/main/scala/cats/kernel/instances/StaticMethods.scala @@ -22,8 +22,8 @@ object StaticMethods extends cats.kernel.compat.HashCompat { while (true) { if (xs.hasNext) { if (ys.hasNext) { - val x = xs.next - val y = ys.next + val x = xs.next() + val y = ys.next() val cmp = ev.compare(x, y) if (cmp != 0) return cmp } else { @@ -40,8 +40,8 @@ object StaticMethods extends cats.kernel.compat.HashCompat { while (true) { if (xs.hasNext) { if (ys.hasNext) { - val x = xs.next - val y = ys.next + val x = xs.next() + val y = ys.next() val cmp = ev.partialCompare(x, y) if (cmp != 0.0) return cmp } else { @@ -58,7 +58,7 @@ object StaticMethods extends cats.kernel.compat.HashCompat { while (true) { if (xs.hasNext) { if (ys.hasNext) { - if (ev.neqv(xs.next, ys.next)) return false + if (ev.neqv(xs.next(), ys.next())) return false } else { return false } @@ -73,12 +73,12 @@ object StaticMethods extends cats.kernel.compat.HashCompat { def combineNIterable[A, R](b: mutable.Builder[A, R], x: Iterable[A], n: Int): R = { var i = n while (i > 0) { b ++= x; i -= 1 } - b.result + b.result() } def combineAllIterable[A, R](b: mutable.Builder[A, R], xs: IterableOnce[Iterable[A]]): R = { xs.iterator.foreach(b ++= _) - b.result + b.result() } // Adapted from scala.util.hashing.MurmurHash#productHash. diff --git a/laws/src/main/scala/cats/laws/discipline/ExhaustiveCheck.scala b/laws/src/main/scala/cats/laws/discipline/ExhaustiveCheck.scala index f821f0cdb0..3db53269c5 100644 --- a/laws/src/main/scala/cats/laws/discipline/ExhaustiveCheck.scala +++ b/laws/src/main/scala/cats/laws/discipline/ExhaustiveCheck.scala @@ -65,5 +65,5 @@ object ExhaustiveCheck { * in the domain of `Set[A]`, so use this only on small domains. */ def forSet[A](implicit A: ExhaustiveCheck[A]): ExhaustiveCheck[Set[A]] = - instance(A.allValues.toSet.subsets.toList) + instance(A.allValues.toSet.subsets().toList) } diff --git a/tests/src/test/scala/cats/tests/ChainSuite.scala b/tests/src/test/scala/cats/tests/ChainSuite.scala index 2be69283d1..678c944bc3 100644 --- a/tests/src/test/scala/cats/tests/ChainSuite.scala +++ b/tests/src/test/scala/cats/tests/ChainSuite.scala @@ -226,18 +226,18 @@ class ChainSuite extends CatsSuite { forAll { (a: Chain[Int]) => val it = a.iterator - while (it.hasNext) it.next + while (it.hasNext) it.next() intercept[java.util.NoSuchElementException] { - it.next + it.next() } val rit = a.reverseIterator - while (rit.hasNext) rit.next + while (rit.hasNext) rit.next() intercept[java.util.NoSuchElementException] { - rit.next + rit.next() } () }