Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
scala: [2.12.20, 2.13.16]
scala: [2.12.20, 2.13.17]
java: [temurin@8]
platform: [jvm, js, native]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.16]
scala: [2.13.17]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
Expand Down
21 changes: 12 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import com.github.sbt.git.SbtGit.GitKeys.*
import sbtcrossproject.CrossProject

val Scala212 = "2.12.20"
val Scala213 = "2.13.16"
val Scala213 = "2.13.17"

commonSettings
noPublishSettings
Expand Down Expand Up @@ -64,22 +64,25 @@ def scalacOptionsAll(pluginJar: File) = List(
"-language:higherKinds,implicitConversions",
"-Xfatal-warnings",
"-Wconf:cat=other-implicit-type:s",
"-Ywarn-unused:-implicits,-nowarn",
s"-Xplugin:${pluginJar.getAbsolutePath}",
s"-Jdummy=${pluginJar.lastModified}"
)

val disableLints = List(
"adapted-args",
"delayedinit-select",
"nullary-unit",
"package-object-classes",
"type-parameter-shadow",
"infer-any"
)

lazy val commonSettings = crossVersionSharedSources ++ Seq(
resolvers += Resolver.sonatypeCentralSnapshots,
incOptions := incOptions.value.withLogRecompileOnMacro(false),
scalacOptions := scalacOptionsAll((plugin / Compile / packageBin).value),
Compile / compile / scalacOptions ++= Seq(
"-Ywarn-unused:-implicits",
"-Xlint:-adapted-args,-delayedinit-select,-nullary-unit,-package-object-classes,-type-parameter-shadow,_"
),
Compile / compile / scalacOptions ++= (scalaBinaryVersion.value match {
case "2.13" => Seq("-Xlint:-byname-implicit")
case _ => Nil
}),
Compile / compile / scalacOptions += disableLints.iterator.map("-" + _).mkString("-Xlint:", ",", ",_"),
Compile / console / scalacOptions -= "-Xfatal-warnings",
Test / console / scalacOptions -= "-Xfatal-warnings",
console / initialCommands := """import shapeless._""",
Expand Down
28 changes: 15 additions & 13 deletions core/shared/src/main/scala/shapeless/alacarte.scala
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,19 @@ trait DefaultCaseClassDefns extends
pgen0: Generic.Aux[P0, Repr0],
typ0: Typeable[C],
tag0: ClassTag[C]
) =
new CaseClassOps {
type Repr = Repr0
type LRepr = LRepr0
type P = P0
val gen = gen0
val lgen = lgen0
val pgen = pgen0
val typ = typ0
val tag = tag0
val productPrefix = tag0.runtimeClass.getName.split("(\\.|\\$)").last
val productArity = toInt()
}
): CaseClassOps {
type Repr = Repr0
type LRepr = LRepr0
type P = P0
} = new CaseClassOps {
type Repr = Repr0
type LRepr = LRepr0
type P = P0
val gen = gen0
val lgen = lgen0
val pgen = pgen0
val typ = typ0
val productPrefix = tag0.runtimeClass.getName.split("([.$])").last
val productArity = toInt()
}
}
3 changes: 2 additions & 1 deletion core/shared/src/main/scala/shapeless/ops/coproduct.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package ops

import poly._

import annotation.implicitNotFound
import annotation.{implicitNotFound, nowarn}

object coproduct {

Expand Down Expand Up @@ -1281,6 +1281,7 @@ object coproduct {
def apply[In <: Coproduct](in: In)(implicit ev: LiftAll[F, In]): Aux[F, In, ev.Out] = ev
}

@nowarn
def apply[F[_]]: Curried[F] = new Curried[F]
def apply[F[_], In <: Coproduct](implicit ev: LiftAll[F, In]): Aux[F, In, ev.Out] = ev

Expand Down
6 changes: 4 additions & 2 deletions core/shared/src/main/scala/shapeless/ops/hlists.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
package shapeless
package ops

import scala.annotation.implicitNotFound
import scala.annotation.{implicitNotFound, nowarn}
import scala.collection._
import scala.collection.mutable

import poly._

object hlist {
Expand Down Expand Up @@ -715,9 +714,11 @@ object hlist {
/**
* Type aliases and constructors provided for backward compatibility
**/
@nowarn
type ToArray[L <: HList, Lub] = ToTraversable.Aux[L, Array, Lub]
def ToArray[L <: HList, Lub](implicit toArray: ToArray[L, Lub]) = toArray

@nowarn
type ToList[L <: HList, Lub] = ToTraversable.Aux[L, List, Lub]
def ToList[L <: HList, Lub](implicit toList: ToList[L, Lub]) = toList

Expand Down Expand Up @@ -2914,6 +2915,7 @@ object hlist {
def apply[In <: HList](in: In)(implicit lift: LiftAll[F, In]): Aux[F, In, lift.Out] = lift
}

@nowarn
def apply[F[_]]: Curried[F] = new Curried[F]
def apply[F[_], In <: HList](implicit lift: LiftAll[F, In]): Aux[F, In, lift.Out] = lift

Expand Down
9 changes: 6 additions & 3 deletions examples/src/main/scala/shapeless/examples/alacache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ trait CachedCaseClassDefns extends
pgen0: Generic.Aux[P0, Repr0],
typ0: Typeable[C],
tag0: ClassTag[C]
) = {
): CaseClassOps {
type Repr = Repr0
type LRepr = LRepr0
type P = P0
} = {
val fqn = tag0.runtimeClass.getName
new CaseClassOps {
type Repr = Repr0
Expand All @@ -175,9 +179,8 @@ trait CachedCaseClassDefns extends
val lgen = lgen0
val pgen = pgen0
val typ = typ0
val tag = tag0
val logger = Logger.getLogger(fqn)
val productPrefix = fqn.split("(\\.|\\$)").last
val productPrefix = fqn.split("([.$])").last
val productArity = toInt()
}
}
Expand Down