Skip to content

Commit

Permalink
Backport "Also compute base classes of wildcardTypes" to LTS (#20836)
Browse files Browse the repository at this point in the history
Backports #19465 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jun 28, 2024
2 parents 1053113 + 97735ed commit e4e2ffe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ object Types extends TypeUtils {
tp.superType.baseClasses
case tp: ClassInfo =>
tp.cls.classDenot.baseClasses
case tp: WildcardType =>
tp.effectiveBounds.hi.baseClasses
case _ => Nil
catch case ex: Throwable =>
handleRecursive("base classes of", this.show, ex)
Expand Down
5 changes: 5 additions & 0 deletions tests/pos/i19460.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type T[A] = A | Any

def perform[A](using T[A]): A = perform2

def perform2[A](using T[A]): A = ???

0 comments on commit e4e2ffe

Please sign in to comment.