Skip to content

Commit

Permalink
Abstract bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
joroKr21 committed May 5, 2024
1 parent a203ad0 commit 3039adf
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 379 deletions.
11 changes: 11 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.typesafe.tools.mima.core.{DirectMissingMethodProblem, ProblemFilters}

val scala3Version = "3.3.3"

ThisBuild / organization := "org.typelevel"
Expand Down Expand Up @@ -63,6 +65,15 @@ lazy val deriving = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.jsEnablePlugins(ScalaJSJUnitPlugin)
.nativeEnablePlugins(ScalaNativeJUnitPlugin)
.settings(libraryDependencies += "org.typelevel" %%% "cats-core" % "2.10.0" % "test")
.settings(
mimaBinaryIssueFilters ++= Seq(
// Those are objects:
ProblemFilters.exclude[DirectMissingMethodProblem]("shapeless3.deriving.K0.<clinit>"),
ProblemFilters.exclude[DirectMissingMethodProblem]("shapeless3.deriving.K1.<clinit>"),
ProblemFilters.exclude[DirectMissingMethodProblem]("shapeless3.deriving.K11.<clinit>"),
ProblemFilters.exclude[DirectMissingMethodProblem]("shapeless3.deriving.K2.<clinit>")
)
)

lazy val derivingJVM = deriving.jvm
lazy val derivingJS = deriving.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import scala.compiletime.*
import scala.util.NotGiven

object Kinds:
/** Like [[Tuple.Head]] but without a bounds restriction. */
type Head[T] = T match
case h *: _ => h

/** Like [[Tuple.Tail]] but without a bounds restriction. */
type Tail[T] <: Tuple = T match
case _ *: t => t

transparent inline def summonFirst[T]: Any =
inline erasedValue[T] match
case _: (a *: b) =>
Expand Down
Loading

0 comments on commit 3039adf

Please sign in to comment.