@@ -227,9 +227,7 @@ object Eq {
227227 import scala .compiletime .{erasedValue , error , summonFrom }
228228 import TypeLevel ._
229229
230- inline def tryEql [T ](x : T , y : T ) = summonFrom {
231- case eq : Eq [T ] => eq.eql(x, y)
232- }
230+ inline def tryEql [T ](x : T , y : T ) = summonInline[Eq [T ]].eql(x, y)
233231
234232 inline def eqlElems [Elems <: Tuple ](xm : Mirror , ym : Mirror , n : Int ): Boolean =
235233 inline erasedValue[Elems ] match {
@@ -283,14 +281,12 @@ trait Pickler[T] {
283281}
284282
285283object Pickler {
286- import scala .compiletime .{erasedValue , constValue , error , summonFrom }
284+ import scala .compiletime .{erasedValue , constValue , error , summonInline }
287285 import TypeLevel ._
288286
289287 def nextInt (buf : mutable.ListBuffer [Int ]): Int = try buf.head finally buf.trimStart(1 )
290288
291- inline def tryPickle [T ](buf : mutable.ListBuffer [Int ], x : T ): Unit = summonFrom {
292- case pkl : Pickler [T ] => pkl.pickle(buf, x)
293- }
289+ inline def tryPickle [T ](buf : mutable.ListBuffer [Int ], x : T ): Unit = summonInline[Pickler [T ]].pickle(buf, x)
294290
295291 inline def pickleElems [Elems <: Tuple ](buf : mutable.ListBuffer [Int ], elems : Mirror , n : Int ): Unit =
296292 inline erasedValue[Elems ] match {
@@ -321,9 +317,7 @@ object Pickler {
321317 case _ : Unit =>
322318 }
323319
324- inline def tryUnpickle [T ](buf : mutable.ListBuffer [Int ]): T = summonFrom {
325- case pkl : Pickler [T ] => pkl.unpickle(buf)
326- }
320+ inline def tryUnpickle [T ](buf : mutable.ListBuffer [Int ]): T = summonInline[Pickler [T ]].unpickle(buf)
327321
328322 inline def unpickleElems [Elems <: Tuple ](buf : mutable.ListBuffer [Int ], elems : Array [AnyRef ], n : Int ): Unit =
329323 inline erasedValue[Elems ] match {
@@ -382,9 +376,7 @@ object Show {
382376 import scala .compiletime .{erasedValue , error , summonFrom }
383377 import TypeLevel ._
384378
385- inline def tryShow [T ](x : T ): String = summonFrom {
386- case s : Show [T ] => s.show(x)
387- }
379+ inline def tryShow [T ](x : T ): String = summonInline[Show [T ]].show(x)
388380
389381 inline def showElems [Elems <: Tuple ](elems : Mirror , n : Int ): List [String ] =
390382 inline erasedValue[Elems ] match {
0 commit comments