Skip to content

Commit

Permalink
use SAM instead of anonymous class
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k authored Sep 23, 2024
1 parent 4126027 commit 0ecbb34
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 0ecbb34

Please sign in to comment.