Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract bounds #221

Merged
merged 1 commit into from
May 11, 2024
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
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