I suspect this is actually a case for summonInline
.
transparent inline def f[A](inline x: A) =
someRepetitiveMethodCall(x)(using summonInline[TypeClass[A]]).anotherRepetitiveMethodCall
For your real use case perhaps that will still require quite complex code. Which brings us back to this old suggestion of mine:
1 Like