Scala 3 has an API for implicit lookup:
trait Quotes {
trait refelectModle {
// quotes.reflect.Implicits
trait ImplicitsModule { self: Implicits.type =>
/** Find a given instance of type `T` in the current scope provided by the current enclosing splice.
* Return an `ImplicitSearchResult`.
*
* @param tpe type of the implicit parameter
*/
def search(tpe: TypeRepr): ImplicitSearchResult
}
}
}
My Problem is: Is there ay API for lookup extensions methods such as:
// search for a matchable method for tpe.name[typeArgs](args) and return the method symbol.
// include search for the tpe itself, or extension methods.
def search(tpe: TypeRepr, name: String, typeArgs: List[TypeRepr],
args: List[List[TypeRepr]]): Option[Symbol]
eg:
search( TypeReprt.of[String], "toInt", Nil, Nil) ==
symbol( scala.collection.StringOps#toInt )