From 6d42e56adc886cd7d43aaeff4b1a408fc4c19bd3 Mon Sep 17 00:00:00 2001 From: LUC DUZAN Date: Fri, 9 Sep 2022 16:43:42 +0200 Subject: [PATCH 1/5] Fix Gen.instant (#7325) --- .../src/test/scala/zio/test/GenSpec.scala | 20 ++++++++++++++++++- .../main/scala/zio/test/TimeVariants.scala | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/test-tests/shared/src/test/scala/zio/test/GenSpec.scala b/test-tests/shared/src/test/scala/zio/test/GenSpec.scala index 20fbbdf48fda..ee29fca59b9c 100644 --- a/test-tests/shared/src/test/scala/zio/test/GenSpec.scala +++ b/test-tests/shared/src/test/scala/zio/test/GenSpec.scala @@ -44,6 +44,7 @@ object GenSpec extends ZIOBaseSpec { val p = (as ++ bs).reverse == (as.reverse ++ bs.reverse) if (p) assert(())(Assertion.anything) else assert((as, bs))(Assertion.nothing) } + assertM(CheckN(100)(gen)(test).map { result => result.failures.fold(false) { case BoolAlgebra.Value(FailureDetailsResult(failureDetails, _)) => @@ -255,6 +256,22 @@ object GenSpec extends ZIOBaseSpec { val max = Instant.ofEpochSecond(74576982873324L, 345345345) checkSample(Gen.instant(min, max))(forall(isGreaterThanEqualTo(min) && isLessThanEqualTo(max))) }, + testM("instant generates values in range when upper and lower bound share same second ") { + val min = Instant.ofEpochSecond(1, 2) + val max = Instant.ofEpochSecond(1, 3) + checkSample(Gen.instant(min, max))(forall(isGreaterThanEqualTo(min) && isLessThanEqualTo(max))) + }, + testM("instant generates values in range when upper bound nano part is smaller than lower bound one") { + val min = Instant.ofEpochSecond(2, 1) + val max = Instant.ofEpochSecond(3, 9) + checkSample(Gen.instant(min, max))(forall(isGreaterThanEqualTo(min) && isLessThanEqualTo(max))) + }, + testM("instant generates one value when upper and lower bound are equals") { + val anInstant = Instant.ofEpochSecond(1, 1) + checkSample(Gen.instant(anInstant, anInstant))( + forall(equalTo(anInstant)) + ) + }, testM("int generates values in range") { checkSample(smallInt)(forall(isGreaterThanEqualTo(-10) && isLessThanEqualTo(10))) }, @@ -750,7 +767,8 @@ object GenSpec extends ZIOBaseSpec { case object Pop extends Command final case class Push(value: Int) extends Command - val genPop: Gen[Any, Command] = Gen.const(Pop) + val genPop: Gen[Any, Command] = Gen.const(Pop) + def genPush: Gen[Random, Command] = Gen.anyInt.map(value => Push(value)) val genCommands: Gen[Random with Sized, List[Command]] = diff --git a/test/shared/src/main/scala/zio/test/TimeVariants.scala b/test/shared/src/main/scala/zio/test/TimeVariants.scala index 631f59074e4a..ca2d3f482797 100644 --- a/test/shared/src/main/scala/zio/test/TimeVariants.scala +++ b/test/shared/src/main/scala/zio/test/TimeVariants.scala @@ -192,7 +192,7 @@ trait TimeVariants { */ final def instant(min: Instant, max: Instant): Gen[Random, Instant] = { - def genSecond(min: Instant, max: Instant): Gen[Random, Long] = Gen.long(min.getEpochSecond, max.getEpochSecond - 1) + def genSecond(min: Instant, max: Instant): Gen[Random, Long] = Gen.long(min.getEpochSecond, max.getEpochSecond) def genNano(min: Instant, max: Instant, second: Long): Gen[Random, Long] = { val minNano = if (min.getEpochSecond == second) min.getNano.toLong else 0L From ad7da11909cec4990d121b827875233504496152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Sumis=C5=82awski?= Date: Fri, 7 Oct 2022 00:15:33 +0200 Subject: [PATCH 2/5] Make concatenation of empty chunks 600 times faster (#7396) * Extend benchmark coverage of Chunk concatenation * Improve performance of concatenation of empty Chunks * replace unused identifier with _ --- .../zio/chunks/ChunkConcatBenchmarks.scala | 94 ++++++++++++++++--- core/shared/src/main/scala/zio/Chunk.scala | 6 +- 2 files changed, 83 insertions(+), 17 deletions(-) diff --git a/benchmarks/src/main/scala/zio/chunks/ChunkConcatBenchmarks.scala b/benchmarks/src/main/scala/zio/chunks/ChunkConcatBenchmarks.scala index 0e5b09b941f7..64c30f8892b5 100644 --- a/benchmarks/src/main/scala/zio/chunks/ChunkConcatBenchmarks.scala +++ b/benchmarks/src/main/scala/zio/chunks/ChunkConcatBenchmarks.scala @@ -10,23 +10,29 @@ import java.util.concurrent.TimeUnit @OutputTimeUnit(TimeUnit.SECONDS) class ChunkConcatBenchmarks { - val chunk: Chunk[Int] = Chunk.empty - @Param(Array("10000")) var size: Int = _ - def concatBalanced(n: Int): Chunk[Int] = - if (n == 0) Chunk.empty - else if (n == 1) Chunk(1) - else concatBalanced(n / 2) ++ concatBalanced(n / 2) + var chunk0: Chunk[Int] = _ + var chunk1: Chunk[Int] = _ + var chunk10: Chunk[Int] = _ + var chunkHalfSize: Chunk[Int] = _ + + @Setup + def setUp(): Unit = { + chunk0 = Chunk.empty + chunk1 = Chunk.single(1) + chunk10 = Chunk.fill(10)(1) + chunkHalfSize = Chunk.fill(size / 2)(1) + } @Benchmark - def leftConcat(): Chunk[Int] = { + def leftConcat0(): Chunk[Int] = { var i = 1 - var current = chunk + var current = chunk0 while (i < size) { - current = Chunk(i) ++ current + current = chunk0 ++ current i += 1 } @@ -34,12 +40,38 @@ class ChunkConcatBenchmarks { } @Benchmark - def rightConcat(): Chunk[Int] = { + def leftConcat1(): Chunk[Int] = { + var i = 1 + var current = chunk1 + + while (i < size) { + current = chunk1 ++ current + i += 1 + } + + current + } + + @Benchmark + def leftConcat10(): Chunk[Int] = { + var i = 1 + var current = chunk10 + + while (i < size) { + current = chunk10 ++ current + i += 10 + } + + current + } + + @Benchmark + def rightConcat0(): Chunk[Int] = { var i = 1 - var current = chunk + var current = chunk0 while (i < size) { - current = current ++ Chunk(i) + current = current ++ chunk0 i += 1 } @@ -47,6 +79,40 @@ class ChunkConcatBenchmarks { } @Benchmark - def balancedConcat(): Chunk[Int] = - concatBalanced(size) + def rightConcat1(): Chunk[Int] = { + var i = 1 + var current = chunk1 + + while (i < size) { + current = current ++ chunk1 + i += 1 + } + + current + } + + @Benchmark + def rightConcat10(): Chunk[Int] = { + var i = 1 + var current = chunk10 + + while (i < size) { + current = current ++ chunk10 + i += 10 + } + + current + } + @Benchmark + def balancedConcatOnce(): Chunk[Int] = + chunkHalfSize ++ chunkHalfSize + + @Benchmark + def balancedConcatRecursive(): Chunk[Int] = + concatBalancedRec(size) + + def concatBalancedRec(n: Int): Chunk[Int] = + if (n == 0) Chunk.empty + else if (n == 1) chunk1 + else concatBalancedRec(n / 2) ++ concatBalancedRec(n / 2) } diff --git a/core/shared/src/main/scala/zio/Chunk.scala b/core/shared/src/main/scala/zio/Chunk.scala index 4633f85c39e7..6cb7fde075cd 100644 --- a/core/shared/src/main/scala/zio/Chunk.scala +++ b/core/shared/src/main/scala/zio/Chunk.scala @@ -1340,7 +1340,7 @@ object Chunk extends ChunkFactory with ChunkPlatformSpecific { case x: AppendN[A] => x.classTag case x: Arr[A] => x.classTag case x: Concat[A] => x.classTag - case Empty => classTag[java.lang.Object].asInstanceOf[ClassTag[A]] + case _: Empty.type => classTag[java.lang.Object].asInstanceOf[ClassTag[A]] case x: PrependN[A] => x.classTag case x: Singleton[A] => x.classTag case x: Slice[A] => x.classTag @@ -1621,8 +1621,8 @@ object Chunk extends ChunkFactory with ChunkPlatformSpecific { implicit val classTag: ClassTag[A] = left match { - case Empty => classTagOf(right) - case _ => classTagOf(left) + case _: Empty.type => classTagOf(right) + case _ => classTagOf(left) } override val depth: Int = From 61b4933c4a7c63799b395b2f50aad5a6f28c360f Mon Sep 17 00:00:00 2001 From: shawjef3 Date: Thu, 6 Oct 2022 19:39:25 -0400 Subject: [PATCH 3/5] Improve Chunk concatenation performance when either chunk is empty. (#7399) --- core/shared/src/main/scala/zio/Chunk.scala | 68 ++++++++++++---------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/core/shared/src/main/scala/zio/Chunk.scala b/core/shared/src/main/scala/zio/Chunk.scala index 6cb7fde075cd..88e16a8cb135 100644 --- a/core/shared/src/main/scala/zio/Chunk.scala +++ b/core/shared/src/main/scala/zio/Chunk.scala @@ -50,45 +50,51 @@ sealed abstract class Chunk[+A] extends ChunkLike[A] { self => * Returns the concatenation of this chunk with the specified chunk. */ final def ++[A1 >: A](that: Chunk[A1]): Chunk[A1] = - (self, that) match { - case (Chunk.AppendN(start, buffer, bufferUsed, _), that) => - val chunk = Chunk.fromArray(buffer.asInstanceOf[Array[A1]]).take(bufferUsed) - start ++ chunk ++ that - case (self, Chunk.PrependN(end, buffer, bufferUsed, _)) => - val chunk = Chunk.fromArray(buffer.asInstanceOf[Array[A1]]).takeRight(bufferUsed) - self ++ chunk ++ end - case (self, that) => - val diff = that.depth - self.depth - if (math.abs(diff) <= 1) Chunk.Concat(self, that) - else if (diff < -1) { - if (self.left.depth >= self.right.depth) { - val nr = self.right ++ that - Chunk.Concat(self.left, nr) - } else { - val nrr = self.right.right ++ that - if (nrr.depth == self.depth - 3) { - val nr = Chunk.Concat(self.right.left, nrr) + if (isEmpty) { + that + } else if (that.isEmpty) { + self + } else { + (self, that) match { + case (Chunk.AppendN(start, buffer, bufferUsed, _), that) => + val chunk = Chunk.fromArray(buffer.asInstanceOf[Array[A1]]).take(bufferUsed) + start ++ chunk ++ that + case (self, Chunk.PrependN(end, buffer, bufferUsed, _)) => + val chunk = Chunk.fromArray(buffer.asInstanceOf[Array[A1]]).takeRight(bufferUsed) + self ++ chunk ++ end + case (self, that) => + val diff = that.depth - self.depth + if (math.abs(diff) <= 1) Chunk.Concat(self, that) + else if (diff < -1) { + if (self.left.depth >= self.right.depth) { + val nr = self.right ++ that Chunk.Concat(self.left, nr) } else { - val nl = Chunk.Concat(self.left, self.right.left) - Chunk.Concat(nl, nrr) + val nrr = self.right.right ++ that + if (nrr.depth == self.depth - 3) { + val nr = Chunk.Concat(self.right.left, nrr) + Chunk.Concat(self.left, nr) + } else { + val nl = Chunk.Concat(self.left, self.right.left) + Chunk.Concat(nl, nrr) + } } - } - } else { - if (that.right.depth >= that.left.depth) { - val nl = self ++ that.left - Chunk.Concat(nl, that.right) } else { - val nll = self ++ that.left.left - if (nll.depth == that.depth - 3) { - val nl = Chunk.Concat(nll, that.left.right) + if (that.right.depth >= that.left.depth) { + val nl = self ++ that.left Chunk.Concat(nl, that.right) } else { - val nr = Chunk.Concat(that.left.right, that.right) - Chunk.Concat(nll, nr) + val nll = self ++ that.left.left + if (nll.depth == that.depth - 3) { + val nl = Chunk.Concat(nll, that.left.right) + Chunk.Concat(nl, that.right) + } else { + val nr = Chunk.Concat(that.left.right, that.right) + Chunk.Concat(nll, nr) + } } } - } + } } final def ++[A1 >: A](that: NonEmptyChunk[A1]): NonEmptyChunk[A1] = From 38bb018b10ba9dda85da2941c6a24d4340014524 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Mon, 17 Oct 2022 19:26:31 +0200 Subject: [PATCH 4/5] Update things for Scala Native (still no running tests) (#7409) * Scala Native: run tests * Native: Run scala-native-loop in OneShot#get * Native: Test / fork := false * ci.yaml: testPlatforms on Scala 3 * ci.yaml: testPlatforms 180 min timeout * ci.yaml: testPlatforms 360 min timeout * ci.yaml: testPlatforms on Scala 3 * Update versions * Update versions * Update munit * Update things for Scala Native (still no running tests) * Update * Scala 2.12.16, 2.13.8 --- .github/workflows/ci.yml | 2 +- build.sbt | 6 +++--- project/BuildHelper.scala | 7 ++++--- project/plugins.sbt | 6 +++--- .../scala/zio/test/ConcurrentHashMap.scala | 19 +++++++++++++------ 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be87c083c73b..4e83839ca4ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,7 @@ jobs: strategy: fail-fast: false matrix: - scala: ['2.11.12', '2.12.15', '2.13.8', '3.1.2'] + scala: ['2.11.12', '2.12.16', '2.13.8', '3.2.0'] java: ['17'] platform: ['JVM'] steps: diff --git a/build.sbt b/build.sbt index 9ea97d47948d..b23e2625db85 100644 --- a/build.sbt +++ b/build.sbt @@ -229,7 +229,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(stdSettings("zio")) .settings(crossProjectSettings) .settings(buildInfoSettings("zio")) - .settings(libraryDependencies += "dev.zio" %%% "izumi-reflect" % "2.1.3") + .settings(libraryDependencies += "dev.zio" %%% "izumi-reflect" % "2.2.0") .enablePlugins(BuildInfoPlugin) .jvmSettings( replSettings, @@ -715,8 +715,8 @@ lazy val docs = project.module "org.http4s" %% "http4s-dsl" % http4sV, "com.github.ghostdogpr" %% "caliban" % "1.2.0", "com.github.ghostdogpr" %% "caliban-zio-http" % "1.2.0", - "org.scalameta" %% "munit" % "0.7.29", - "com.github.poslegm" %% "munit-zio" % "0.0.3", + "org.scalameta" %% "munit" % "1.0.0-M6", + "com.github.poslegm" %% "munit-zio" % "0.1.1", "nl.vroste" %% "rezilience" % "0.7.0", "io.github.gaelrenoux" %% "tranzactio" % "2.1.0", "io.github.neurodyne" %% "zio-arrow" % "0.2.1", diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 92ffe9e17f11..472b629b4e70 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -25,7 +25,7 @@ object BuildHelper { val Scala213: String = versions("2.13") val Scala3: String = versions("3") - val SilencerVersion = "1.7.8" + val SilencerVersion = "1.7.11" private val stdOptions = Seq( "-deprecation", @@ -259,11 +259,12 @@ object BuildHelper { ) def nativeSettings = Seq( - Test / test := (Test / compile).value + Test / test := (Test / compile).value, + Test / fork := crossProjectPlatform.value == JVMPlatform // set fork to `true` on JVM to improve log readability, JS and Native need `false` ) def jsSettings: List[Def.Setting[_]] = List( - Test / fork := crossProjectPlatform.value != JSPlatform // set fork to `true` for non-JS platforms to improve log readability, JS needs `false` + Test / fork := crossProjectPlatform.value == JVMPlatform // set fork to `true` on JVM to improve log readability, JS and Native need `false` ) def welcomeMessage = onLoadMessage := { diff --git a/project/plugins.sbt b/project/plugins.sbt index 026bf5e9c89a..d9f2d9f47e35 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.0") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.3") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") @@ -9,8 +9,8 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin" addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.5") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.11.0") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("pl.project13.scala" % "sbt-jcstress" % "0.2.0") diff --git a/test/native/src/main/scala/zio/test/ConcurrentHashMap.scala b/test/native/src/main/scala/zio/test/ConcurrentHashMap.scala index 766b49864d84..65767b7dcab8 100644 --- a/test/native/src/main/scala/zio/test/ConcurrentHashMap.scala +++ b/test/native/src/main/scala/zio/test/ConcurrentHashMap.scala @@ -16,16 +16,23 @@ package zio.test -import scala.collection.mutable.Map +import java.util.concurrent.{ConcurrentHashMap => JConcurrentHashMap} -private[test] final case class ConcurrentHashMap[K, V] private (private val map: Map[K, V]) { - def foldLeft[B](z: B)(f: (B, (K, V)) => B): B = - map.foldLeft(z)(f) +private[test] final case class ConcurrentHashMap[K, V] private (private val map: JConcurrentHashMap[K, V]) { + def foldLeft[B](z: B)(op: (B, (K, V)) => B): B = { + var result = z + val it = map.entrySet.iterator + while (it.hasNext) { + val e = it.next() + result = op(result, (e.getKey, e.getValue)) + } + result + } def getOrElseUpdate(key: K, op: => V): V = - map.getOrElseUpdate(key, op) + map.computeIfAbsent(key, _ => op) } private[test] object ConcurrentHashMap { def empty[K, V]: ConcurrentHashMap[K, V] = - new ConcurrentHashMap[K, V](Map.empty[K, V]) + new ConcurrentHashMap[K, V](new JConcurrentHashMap[K, V]()) } From 0aeb528842b9dae3f9de167df28f13c54efe8f5d Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Mon, 17 Oct 2022 21:00:10 +0200 Subject: [PATCH 5/5] fix merge --- core/shared/src/main/scala/zio/Chunk.scala | 74 ++++++++++------------ project/plugins.sbt | 2 +- 2 files changed, 35 insertions(+), 41 deletions(-) diff --git a/core/shared/src/main/scala/zio/Chunk.scala b/core/shared/src/main/scala/zio/Chunk.scala index 9ccb529e5c7f..cf3148d6de6f 100644 --- a/core/shared/src/main/scala/zio/Chunk.scala +++ b/core/shared/src/main/scala/zio/Chunk.scala @@ -46,53 +46,47 @@ sealed abstract class Chunk[+A] extends ChunkLike[A] with Serializable { self => * Returns the concatenation of this chunk with the specified chunk. */ final def ++[A1 >: A](that: Chunk[A1]): Chunk[A1] = - if (isEmpty) { - that - } else if (that.isEmpty) { - self - } else { - (self, that) match { - case (Chunk.AppendN(start, buffer, bufferUsed, _), that) => - val chunk = Chunk.fromArray(buffer.asInstanceOf[Array[A1]]).take(bufferUsed) - start ++ chunk ++ that - case (self, Chunk.PrependN(end, buffer, bufferUsed, _)) => - val chunk = Chunk.fromArray(buffer.asInstanceOf[Array[A1]]).takeRight(bufferUsed) - self ++ chunk ++ end - case (self, Chunk.Empty) => self + (self, that) match { + case (Chunk.AppendN(start, buffer, bufferUsed, _), that) => + val chunk = Chunk.fromArray(buffer.asInstanceOf[Array[A1]]).take(bufferUsed) + start ++ chunk ++ that + case (self, Chunk.PrependN(end, buffer, bufferUsed, _)) => + val chunk = Chunk.fromArray(buffer.asInstanceOf[Array[A1]]).takeRight(bufferUsed) + self ++ chunk ++ end + case (self, Chunk.Empty) => self case (Chunk.Empty, that) => that case (self, that) => - val diff = that.depth - self.depth - if (math.abs(diff) <= 1) Chunk.Concat(self, that) - else if (diff < -1) { - if (self.left.depth >= self.right.depth) { - val nr = self.right ++ that + val diff = that.depth - self.depth + if (math.abs(diff) <= 1) Chunk.Concat(self, that) + else if (diff < -1) { + if (self.left.depth >= self.right.depth) { + val nr = self.right ++ that + Chunk.Concat(self.left, nr) + } else { + val nrr = self.right.right ++ that + if (nrr.depth == self.depth - 3) { + val nr = Chunk.Concat(self.right.left, nrr) Chunk.Concat(self.left, nr) } else { - val nrr = self.right.right ++ that - if (nrr.depth == self.depth - 3) { - val nr = Chunk.Concat(self.right.left, nrr) - Chunk.Concat(self.left, nr) - } else { - val nl = Chunk.Concat(self.left, self.right.left) - Chunk.Concat(nl, nrr) - } + val nl = Chunk.Concat(self.left, self.right.left) + Chunk.Concat(nl, nrr) } + } + } else { + if (that.right.depth >= that.left.depth) { + val nl = self ++ that.left + Chunk.Concat(nl, that.right) } else { - if (that.right.depth >= that.left.depth) { - val nl = self ++ that.left + val nll = self ++ that.left.left + if (nll.depth == that.depth - 3) { + val nl = Chunk.Concat(nll, that.left.right) Chunk.Concat(nl, that.right) } else { - val nll = self ++ that.left.left - if (nll.depth == that.depth - 3) { - val nl = Chunk.Concat(nll, that.left.right) - Chunk.Concat(nl, that.right) - } else { - val nr = Chunk.Concat(that.left.right, that.right) - Chunk.Concat(nll, nr) - } + val nr = Chunk.Concat(that.left.right, that.right) + Chunk.Concat(nll, nr) } } - } + } } /** @@ -1381,7 +1375,7 @@ object Chunk extends ChunkFactory with ChunkPlatformSpecific { case x: AppendN[_] => x.classTag.asInstanceOf[ClassTag[A]] case x: Arr[_] => x.classTag.asInstanceOf[ClassTag[A]] case x: Concat[_] => x.classTag.asInstanceOf[ClassTag[A]] - case _:Empty .type => classTag[java.lang.Object].asInstanceOf[ClassTag[A]] + case Empty => classTag[java.lang.Object].asInstanceOf[ClassTag[A]] case x: PrependN[_] => x.classTag.asInstanceOf[ClassTag[A]] case x: Singleton[_] => x.classTag.asInstanceOf[ClassTag[A]] case x: Slice[_] => x.classTag.asInstanceOf[ClassTag[A]] @@ -1749,8 +1743,8 @@ object Chunk extends ChunkFactory with ChunkPlatformSpecific { implicit val classTag: ClassTag[A] = left match { - case _: Empty.type => classTagOf(right) - case _ => classTagOf(left) + case Empty => classTagOf(right) + case _ => classTagOf(left) } override val depth: Int = diff --git a/project/plugins.sbt b/project/plugins.sbt index b3c19166597a..ae4cb6a9c559 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.0") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.3") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")