@@ -1877,19 +1877,21 @@ object SymDenotations {
1877
1877
super .info_=(tp)
1878
1878
}
1879
1879
1880
- /** The symbols of the parent classes. */
1881
- def parentSyms (using Context ): List [Symbol ] = info match {
1882
- case classInfo : ClassInfo => classInfo.declaredParents.map(_.classSymbol)
1880
+ /** The types of the parent classes. */
1881
+ def parentTypes (using Context ): List [Type ] = info match
1882
+ case classInfo : ClassInfo => classInfo.declaredParents
1883
1883
case _ => Nil
1884
- }
1884
+
1885
+ /** The symbols of the parent classes. */
1886
+ def parentSyms (using Context ): List [Symbol ] =
1887
+ parentTypes.map(_.classSymbol)
1885
1888
1886
1889
/** The symbol of the superclass, NoSymbol if no superclass exists */
1887
- def superClass (using Context ): Symbol = parentSyms match {
1888
- case parent :: _ =>
1889
- if (parent.is(Trait )) NoSymbol else parent
1890
- case _ =>
1891
- NoSymbol
1892
- }
1890
+ def superClass (using Context ): Symbol = parentTypes match
1891
+ case parentType :: _ =>
1892
+ val parentCls = parentType.classSymbol
1893
+ if parentCls.is(Trait ) then NoSymbol else parentCls
1894
+ case _ => NoSymbol
1893
1895
1894
1896
/** The explicitly given self type (self types of modules are assumed to be
1895
1897
* explcitly given here).
@@ -1951,20 +1953,20 @@ object SymDenotations {
1951
1953
def computeBaseData (implicit onBehalf : BaseData , ctx : Context ): (List [ClassSymbol ], BaseClassSet ) = {
1952
1954
def emptyParentsExpected =
1953
1955
is(Package ) || (symbol == defn.AnyClass ) || ctx.erasedTypes && (symbol == defn.ObjectClass )
1954
- val psyms = parentSyms
1955
- if (psyms .isEmpty && ! emptyParentsExpected)
1956
+ val parents = parentTypes
1957
+ if (parents .isEmpty && ! emptyParentsExpected)
1956
1958
onBehalf.signalProvisional()
1957
1959
val builder = new BaseDataBuilder
1958
- def traverse (parents : List [Symbol ]): Unit = parents match {
1960
+ def traverse (parents : List [Type ]): Unit = parents match {
1959
1961
case p :: parents1 =>
1960
- p match {
1962
+ p.classSymbol match {
1961
1963
case pcls : ClassSymbol => builder.addAll(pcls.baseClasses)
1962
1964
case _ => assert(isRefinementClass || p.isError || ctx.mode.is(Mode .Interactive ), s " $this has non-class parent: $p" )
1963
1965
}
1964
1966
traverse(parents1)
1965
1967
case nil =>
1966
1968
}
1967
- traverse(psyms )
1969
+ traverse(parents )
1968
1970
(classSymbol :: builder.baseClasses, builder.baseClassSet)
1969
1971
}
1970
1972
@@ -2312,9 +2314,11 @@ object SymDenotations {
2312
2314
var names = Set [Name ]()
2313
2315
def maybeAdd (name : Name ) = if (keepOnly(thisType, name)) names += name
2314
2316
try {
2315
- for (p <- parentSyms if p.isClass)
2316
- for (name <- p.asClass.memberNames(keepOnly))
2317
- maybeAdd(name)
2317
+ for ptype <- parentTypes do
2318
+ ptype.classSymbol match
2319
+ case pcls : ClassSymbol =>
2320
+ for name <- pcls.memberNames(keepOnly) do
2321
+ maybeAdd(name)
2318
2322
val ownSyms =
2319
2323
if (keepOnly eq implicitFilter)
2320
2324
if (this .is(Package )) Iterator .empty
0 commit comments