Skip to content

Commit

Permalink
Update scala-library, scala-reflect to 2.13.15 (#1046)
Browse files Browse the repository at this point in the history
Co-authored-by: Michel Davit <[email protected]>
  • Loading branch information
scala-steward and RustedBones authored Dec 4, 2024
1 parent b75244e commit c1e73f0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ThisBuild / developers := List(

// scala versions
val scala3 = "3.3.4"
val scala213 = "2.13.14"
val scala213 = "2.13.15"
val scala212 = "2.12.20"
val scalaDefault = scala213
val scala3Projects = List(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import com.google.common.base.Charsets
import com.google.common.hash.{Funnel, Funnels, PrimitiveSink}
import magnolia1._

import scala.annotation.nowarn

object FunnelDerivation {
type Typeclass[T] = Funnel[T]

Expand All @@ -31,7 +29,7 @@ object FunnelDerivation {
val p = caseClass.parameters.head
p.typeclass.funnel(p.dereference(from), into)
} else if (caseClass.parameters.isEmpty) {
into.putString(caseClass.typeName.short, Charsets.UTF_8): @nowarn
val _ = into.putString(caseClass.typeName.short, Charsets.UTF_8)
} else {
caseClass.parameters.foreach { p =>
// inject index to distinguish cases like `(Some(1), None)` and `(None, Some(1))`
Expand All @@ -54,17 +52,19 @@ object FunnelDerivation {
}

trait FunnelImplicits {
private def funnel[T](f: (PrimitiveSink, T) => Unit): Funnel[T] = new Funnel[T] {
override def funnel(from: T, into: PrimitiveSink): Unit = f(into, from)
private def funnel[T](f: (PrimitiveSink, T) => Any): Funnel[T] = new Funnel[T] {
override def funnel(from: T, into: PrimitiveSink): Unit = {
val _ = f(into, from)
}
}

implicit val intFunnel: Funnel[Int] = Funnels.integerFunnel().asInstanceOf[Funnel[Int]]
implicit val longFunnel: Funnel[Long] = Funnels.longFunnel().asInstanceOf[Funnel[Long]]
implicit val bytesFunnel: Funnel[Array[Byte]] = Funnels.byteArrayFunnel()
implicit val booleanFunnel: Funnel[Boolean] = funnel[Boolean](_.putBoolean(_): @nowarn)
implicit val byteFunnel: Funnel[Byte] = funnel[Byte](_.putByte(_): @nowarn)
implicit val charFunnel: Funnel[Char] = funnel[Char](_.putChar(_): @nowarn)
implicit val shortFunnel: Funnel[Short] = funnel[Short](_.putShort(_): @nowarn)
implicit val booleanFunnel: Funnel[Boolean] = funnel[Boolean](_.putBoolean(_))
implicit val byteFunnel: Funnel[Byte] = funnel[Byte](_.putByte(_))
implicit val charFunnel: Funnel[Char] = funnel[Char](_.putChar(_))
implicit val shortFunnel: Funnel[Short] = funnel[Short](_.putShort(_))

implicit def charSequenceFunnel[T <: CharSequence]: Funnel[T] =
Funnels.unencodedCharsFunnel().asInstanceOf[Funnel[T]]
Expand All @@ -81,6 +81,6 @@ trait FunnelImplicits {
i += 1
}
// inject size to distinguish `None`, `Some("")`, and `List("", "", ...)`
sink.putInt(i): @nowarn
sink.putInt(i)
}
}
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.7")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.7")
addSbtPlugin("com.github.sbt" % "sbt-paradox-material-theme" % "0.7.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.6.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.2")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.4")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")

0 comments on commit c1e73f0

Please sign in to comment.