Skip to content

Commit

Permalink
Made Underlying typeclass more useful
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Feb 16, 2024
1 parent e2ba4b2 commit 989aab2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/opaque/opaque.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@

package anticipation

erased trait Underlying[OpaqueType, PrimitiveType <: Boolean | Byte | Char | Short | Int | Long | Float | Double]
erased trait Underlying[OpaqueType, PrimitiveType]

extension [OpaqueType](value: OpaqueType)
def underlying[PrimitiveType](using erased Underlying[OpaqueType, PrimitiveType]): PrimitiveType =
value.asInstanceOf[PrimitiveType]

0 comments on commit 989aab2

Please sign in to comment.