Skip to content

Commit

Permalink
Also compute base classes of wildcardTypes
Browse files Browse the repository at this point in the history
Fixes #19460
  • Loading branch information
odersky committed Jan 17, 2024
1 parent 31f837e commit 725c425
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 @@ -657,6 +657,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 725c425

Please sign in to comment.