Skip to content

Commit

Permalink
Backport "Use final result type to check selector bound" to 3.5.0 (#2…
Browse files Browse the repository at this point in the history
…1010)

Backports #20989 to 3.5.0-RC3
  • Loading branch information
WojciechMazur authored Jul 4, 2024
2 parents 9ca1d0a + 3677eaf commit f4bde0b
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 @@ -728,7 +728,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 f4bde0b

Please sign in to comment.