Skip to content

Add NotGiven compatibility module#180

Open
bpholt wants to merge 1 commit intotypelevel:mainfrom
Dwolla:notgiven
Open

Add NotGiven compatibility module#180
bpholt wants to merge 1 commit intotypelevel:mainfrom
Dwolla:notgiven

Conversation

@bpholt
Copy link
Copy Markdown
Member

@bpholt bpholt commented Apr 8, 2026

Scala 3 introduced scala.util.NotGiven: a special class used to implement negation in implicit search.

While techniques existed to implement this functionality in some cases in Scala 2, the NotGiven trait was not backported to Scala 2. This makes cross-compilation more frustrating than it needs to be, so this module was created to make a single org.typelevel.scalaccompat.scala.util.NotGiven available to Scala 2.12, 2.13, and 3.

This is based on prior work by Shapeless and fs2.

This was initially proposed as typelevel/tsc#171, but I agree that this repo is a better home for this code.

@bpholt bpholt force-pushed the notgiven branch 2 times, most recently from fee9115 to 537e147 Compare April 8, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant