Skip to content

Commit

Permalink
Abstract bounds (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
joroKr21 authored May 11, 2024
1 parent e32a837 commit cbe2d74
Show file tree
Hide file tree
Showing 3 changed files with 135 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 cbe2d74

Please sign in to comment.