Skip to content

Commit

Permalink
Merge pull request #1294 from xuwei-k/patch-2
Browse files Browse the repository at this point in the history
use SAM instead of anonymous class
  • Loading branch information
fthomas authored Oct 1, 2024
2 parents c26ffc3 + c705703 commit cbce610
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object ToInt {
def apply[N <: Int](implicit toInt: ToInt[N]): ToInt[N] = toInt

inline implicit def materialize[N <: Int]: ToInt[N] =
new ToInt[N] { override def apply(): Int = toInt[N] }
() => toInt[N]

private inline def toInt[N <: Int]: Int =
inline erasedValue[N] match {
Expand Down

0 comments on commit cbce610

Please sign in to comment.