Skip to content

Commit e4e2ffe

Browse files
Backport "Also compute base classes of wildcardTypes" to LTS (#20836)
Backports #19465 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents 1053113 + 97735ed commit e4e2ffe

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

+2
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,8 @@ object Types extends TypeUtils {
640640
tp.superType.baseClasses
641641
case tp: ClassInfo =>
642642
tp.cls.classDenot.baseClasses
643+
case tp: WildcardType =>
644+
tp.effectiveBounds.hi.baseClasses
643645
case _ => Nil
644646
catch case ex: Throwable =>
645647
handleRecursive("base classes of", this.show, ex)

tests/pos/i19460.scala

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type T[A] = A | Any
2+
3+
def perform[A](using T[A]): A = perform2
4+
5+
def perform2[A](using T[A]): A = ???

0 commit comments

Comments
 (0)