Skip to content

Commit

Permalink
Backport "Use final result type to check selector bound" to LTS (#21166)
Browse files Browse the repository at this point in the history
Backports #20989 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jul 11, 2024
2 parents 1252a0f + 4b39c6f commit 7b1ab13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/CheckUnused.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions tests/pos/i20860.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def `i20860 use result to check selector bound`: Unit =
import Ordering.Implicits.given Ordering[?]
summon[Ordering[Seq[Int]]]

0 comments on commit 7b1ab13

Please sign in to comment.