Closed
Description
This issue is different from #8823 because it is related to conditional implicit definitions, not conversions.
Minimized code
package nonempty
trait Order[A]
object Order {
implicit def orderList[A](implicit orderA: Order[A]): Order[List[A]] = ???
}
class Foo
object Implicits {
implicit def orderFoo: Order[Foo] = ???
}
@main def main: Unit = summon[Order[List[Foo]]]
https://scastie.scala-lang.org/eVaWn1IASUar0hFzfPpVTA
Output
no implicit argument of type Order[List[Foo]] was found for parameter x of method summon in object DottyPredef.
I found:
Order.orderList[A](
/* missing */implicitly[Order[Foo]]
)
But no implicit values were found that match type Order[Foo].
Expectation
We should suggest importing Implicits.orderFoo
.
Note that with the same code, if we try to summon[Order[Foo]]
we get the suggestion to import Implicits.orderFoo
.