How to use `with` style with this `given`?

(Copied here from Discord where I didn’t get a reaction.)

In Scastie - An interactive playground for Scala., I have a working example of a Show typeclass that works for any Product. Now I’d like to rewrite the given using with notation:

inline given productShow[T](using m: Mirror.ProductOf[T]): Show[T] with // =  
  // new Show[T]:
    def show(t: T): String = {
      val shows = summonAllShows[m.MirroredElemTypes]
      (t.asInstanceOf[Product].productIterator).zip(shows.iterator).map { 
        case (p, s) => s.asInstanceOf[Show[Any]].show(p)                  

I thought this would be 100% equivalent, but I get

method summonAllShows is declared as `inline`, but was not inlined
Try increasing `-Xmax-inlines` above 32

If I declare show as inline, I get

(productShow.this.inline$m : => deriving.Mirror.ProductOf[T]) is not a legal path
since it refers to nonfinal method inline$m

Any ideas how to use the with style?



There’s a merged pull request that would fix this Properly desugar `inline given .. with ..` by nicolasstucki · Pull Request #14284 · lampepfl/dotty · GitHub but I’m not sure which Scala version it appears in. I tried switching to the latest RC version in your Scastie snippet, but then it gave som other error.