Skip to content

Commit 6655c70

Browse files
authored
Merge pull request #686 from typelevel/update/scala3-library-3.3.4
Update scala3-library, ... to 3.3.4
2 parents ce450de + 9d459fc commit 6655c70

9 files changed

+19
-16
lines changed

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import sbt.*
22

33
val scala212 = "2.12.20"
44
val scala213 = "2.13.15"
5-
val scala3 = "3.3.3"
5+
val scala3 = "3.3.4"
66

77
ThisBuild / crossScalaVersions := Seq(scala212, scala213, scala3)
88
ThisBuild / scalaVersion := scala3

core/src/main/scala-3/cats/derived/DerivedEmpty.scala

+1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ object DerivedEmpty:
3535
given product[A: ProductInstancesOf[Empty]]: DerivedEmpty[A] =
3636
Empty(ProductInstances.construct([a] => (A: Empty[a]) => A.empty))
3737

38+
@nowarn("id=E197")
3839
inline given coproduct[A: CoproductGeneric]: DerivedEmpty[A] =
3940
Empty(CoproductGeneric.withOnly[DerivedEmpty.Or, A]([a <: A] => (A: DerivedEmpty.Or[a]) => A.unify.empty))

core/src/main/scala-3/cats/derived/DerivedEmptyK.scala

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ object DerivedEmptyK:
6767
given product[F[_]: ProductInstancesOf[EmptyK]]: DerivedEmptyK[F] = new EmptyK[F]:
6868
def empty[A]: F[A] = ProductInstances.construct([f[_]] => (F: EmptyK[f]) => F.empty[A])
6969

70+
@nowarn("id=E197")
7071
inline given coproduct[F[_]: CoproductGeneric]: DerivedEmptyK[F] =
7172
CoproductGeneric.withOnly[DerivedEmptyK.Or, EmptyK[F]]:
7273
[f[x] <: F[x]] => (F: DerivedEmptyK.Or[f]) => F.unify.asInstanceOf[EmptyK[F]]

core/src/test/scala-3/cats/derived/EmptySuite.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class EmptySuite extends KittensSuite:
4141
locally:
4242
import auto.empty.given
4343
validate("auto.empty")
44-
testNoInstance("Empty", "IList[Int]")
45-
testNoInstance("Empty", "Snoc[Int]")
46-
testNoInstance("Empty", "Rgb")
44+
testNoGiven("Empty[IList[Int]]", "alleycats.Empty")
45+
testNoGiven("Empty[Snoc[Int]]", "alleycats.Empty")
46+
testNoGiven("Empty[Rgb]", "alleycats.Empty")
4747

4848
locally:
4949
import semiInstances.given
@@ -58,8 +58,8 @@ class EmptySuite extends KittensSuite:
5858
testNoInstance("strict.semiauto.empty", "Rgb")
5959
testNoInstance("strict.semiauto.empty", "Top")
6060
test("No strict.semiauto.empty for IList[Int] or Snoc[Int]"):
61-
assertNoInstance(compileErrors("given Empty[IList[Int]] = strict.semiauto.empty"))
62-
assertNoInstance(compileErrors("given Empty[Snoc[Int]] = strict.semiauto.empty"))
61+
testNoGiven("given Empty[IList[Int]] = strict.semiauto.empty", "alleycats.Empty")
62+
testNoGiven("given Empty[Snoc[Int]] = strict.semiauto.empty", "alleycats.Empty")
6363

6464
locally:
6565
import derivedInstances.*

core/src/test/scala-3/cats/derived/KittensSuite.scala

+6-5
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ object KittensSuite:
6969
given [A <: Product](using mirror: Mirror.ProductOf[A], via: Cogen[mirror.MirroredElemTypes]): Cogen[A] =
7070
via.contramap(Tuple.fromProductTyped)
7171

72-
def assertNoInstance(errors: String): Unit =
73-
val message = "No given instance of type"
74-
assert(errors.contains(message), s"$errors did not contain $message")
72+
inline def testNoInstance(inline tc: String, inline target: String): Unit =
73+
val tcName = tc.drop(tc.lastIndexOf('.') + 1).capitalize
74+
testNoGiven(tc + "[" + target + "]", s"Could not derive $tcName for")
7575

76-
inline def testNoInstance(inline tc: String, target: String): Unit =
77-
test(s"No $tc for $target")(assertNoInstance(compileErrors(tc + "[" + target + "]")))
76+
inline def testNoGiven(inline code: String, message: String): Unit =
77+
val errors = compileErrors(code)
78+
test(s"No given $code")(assert(errors.contains(message), s"$errors did not contain $message"))

core/src/test/scala-3/cats/derived/NonEmptyTraverseSuite.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package cats.derived
1818

19-
import cats.{Eq, NonEmptyTraverse, Traverse}
19+
import cats.{NonEmptyTraverse, Traverse}
2020
import cats.data.{NonEmptyList, OneAnd}
2121
import cats.derived.Derived.<<<
2222
import cats.laws.discipline.*

core/src/test/scala-3/cats/derived/PureSuite.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class PureSuite extends KittensSuite:
4444
locally:
4545
import auto.pure.given
4646
validate("auto.pure")
47-
testNoInstance("Pure", "IList")
48-
testNoInstance("Pure", "Snoc")
47+
testNoGiven("Pure[IList]", "No given instance of type alleycats.Pure")
48+
testNoGiven("Pure[Snoc]", "No given instance of type alleycats.Pure")
4949

5050
locally:
5151
import semiInstances.given

core/src/test/scala-3/cats/derived/SemigroupSuite.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package cats.derived
1818

19-
import cats.{Eq, Semigroup}
19+
import cats.Semigroup
2020
import cats.kernel.laws.discipline.*
2121
import org.scalacheck.Arbitrary
2222

core/src/test/scala-3/cats/derived/TraverseSuite.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package cats.derived
22

33
import cats.derived.Derived.<<<
4-
import cats.{Eq, Traverse}
4+
import cats.Traverse
55
import cats.laws.discipline.*
66
import shapeless3.deriving.Const
77

0 commit comments

Comments
 (0)