@@ -73,7 +73,7 @@ object SymDenotations {
73
73
class SymDenotation private [SymDenotations ] (
74
74
symbolHint : Symbol | Null ,
75
75
final val common : SymCommon ,
76
- final val maybeOwner : Symbol ,
76
+ ownerOrNull : Symbol | Null ,
77
77
final val name : Name ,
78
78
initFlags : FlagSet ,
79
79
initInfo : Type ,
@@ -91,6 +91,9 @@ object SymDenotations {
91
91
*/
92
92
if (Config .checkNoSkolemsInInfo) assertNoSkolems(initInfo)
93
93
94
+ final def maybeOwner : Symbol =
95
+ if ownerOrNull == null then NoSymbol else ownerOrNull
96
+
94
97
// ------ Getting and setting fields -----------------------------
95
98
96
99
private var myFlags : FlagSet = adaptFlags(initFlags)
@@ -99,7 +102,9 @@ object SymDenotations {
99
102
private var myParamss : List [List [Symbol ]] = Nil
100
103
101
104
/** The owner of the symbol; overridden in NoDenotation */
102
- def owner : Symbol = maybeOwner
105
+ final def owner : Symbol =
106
+ assert(ownerOrNull != null , " NoDenotation.owner" )
107
+ ownerOrNull
103
108
104
109
/** The flag set */
105
110
final def flags (using Context ): FlagSet = { ensureCompleted(); myFlags }
@@ -2057,8 +2062,8 @@ object SymDenotations {
2057
2062
val builder = new BaseDataBuilder
2058
2063
def traverse (parents : List [Type ]): Unit = parents match {
2059
2064
case p :: parents1 =>
2060
- p.classSymbol match {
2061
- case pcls : ClassSymbol => builder.addAll(pcls.baseClasses)
2065
+ p.classSymbol.denot match {
2066
+ case pcls : ClassDenotation => builder.addAll(pcls.baseClasses)
2062
2067
case _ => assert(isRefinementClass || p.isError || ctx.mode.is(Mode .Interactive ), s " $this has non-class parent: $p" )
2063
2068
}
2064
2069
traverse(parents1)
@@ -2414,8 +2419,8 @@ object SymDenotations {
2414
2419
def maybeAdd (name : Name ) = if (keepOnly(thisType, name)) names += name
2415
2420
try {
2416
2421
for ptype <- parentTypes do
2417
- ptype.classSymbol match
2418
- case pcls : ClassSymbol =>
2422
+ ptype.classSymbol.denot match
2423
+ case pcls : ClassDenotation =>
2419
2424
for name <- pcls.memberNames(keepOnly) do
2420
2425
maybeAdd(name)
2421
2426
val ownSyms =
@@ -2678,10 +2683,9 @@ object SymDenotations {
2678
2683
}
2679
2684
2680
2685
@ sharable object NoDenotation
2681
- extends SymDenotation (NoSymbol , SymCommon (NoCoord , 0 , 0 ), NoSymbol , " <none>" .toTermName, Permanent , NoType ) {
2686
+ extends SymDenotation (NoSymbol , SymCommon (NoCoord , 0 , 0 ), null , " <none>" .toTermName, Permanent , NoType ) {
2682
2687
override def isTerm : Boolean = false
2683
2688
override def exists : Boolean = false
2684
- override def owner : Symbol = throw new AssertionError (" NoDenotation.owner" )
2685
2689
override def computeAsSeenFrom (pre : Type )(using Context ): SingleDenotation = this
2686
2690
override def mapInfo (f : Type => Type )(using Context ): SingleDenotation = this
2687
2691
override def asSeenFrom (pre : Type )(using Context ): AsSeenFromResult = this
0 commit comments