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 committed Sep 24, 2024
1 parent 5106bf9 commit c705703
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 c705703

Please sign in to comment.