diff --git a/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala b/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala index d8389ff964a4..d396d60c096a 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala @@ -729,7 +729,7 @@ object CheckUnused: if selector.isGiven then // Further check that the symbol is a given or implicit and conforms to the bound sym.isOneOf(Given | Implicit) - && (selector.bound.isEmpty || sym.info <:< selector.boundTpe) + && (selector.bound.isEmpty || sym.info.finalResultType <:< selector.boundTpe) else // Normal wildcard, check that the symbol is not a given (but can be implicit) !sym.is(Given) diff --git a/tests/pos/i20860.scala b/tests/pos/i20860.scala new file mode 100644 index 000000000000..1e1ddea11b75 --- /dev/null +++ b/tests/pos/i20860.scala @@ -0,0 +1,3 @@ +def `i20860 use result to check selector bound`: Unit = + import Ordering.Implicits.given Ordering[?] + summon[Ordering[Seq[Int]]]