Implicit conversion followed by extension

I have a type class C with an extension m:

trait C[A]:
  def ofString(s: String): A
  def stringOf(a: A): String
  extension (a: A) def m: String = stringOf(a)
  
def code[A: C]: String =
  import scala.language.implicitConversions
  given Conversion[String, A] with 
    def apply(s: String): A = summon[C[A]].ofString(s)
  val ev = summon[C[A]]
  import ev.m
  "Y".m

My question is this: Is there a way to avoid the import ev.m (and the val ev altogether)?

Just "Y".m requires an implicit conversion from String to A, followed by an extension on A, and seems to be too much for the compiler.

(code is here: Scastie - An interactive playground for Scala.)

Consider making the extension a top level one, parameterised by A.

Move the summon[C[A]] into the body of the extension’s m.

I used to have my extensions at the top level, but I noticed others had them in the type class, so I started to imitate that. Maybe that’s something I need to revisit. Is there a good reason to keep them in or out?