@@ -39,8 +39,8 @@ trait SymDenotations { this: Context =>
39
39
initPrivateWithin : Symbol = NoSymbol )(implicit ctx : Context ): SymDenotation = {
40
40
val result =
41
41
if (symbol.isClass)
42
- if (initFlags is Package ) new SymDenotation (symbol, owner, name, initFlags, initInfo, initPrivateWithin) with PackageClassDenotation
43
- else new SymDenotation (symbol, owner, name, initFlags, initInfo, initPrivateWithin) with ClassDenotation
42
+ if (initFlags is Package ) new PackageClassDenotation (symbol, owner, name, initFlags, initInfo, initPrivateWithin)
43
+ else new ClassDenotation (symbol, owner, name, initFlags, initInfo, initPrivateWithin)
44
44
else new SymDenotation (symbol, owner, name, initFlags, initInfo, initPrivateWithin)
45
45
result.validFor = stablePeriod
46
46
result
@@ -1282,7 +1282,14 @@ object SymDenotations {
1282
1282
1283
1283
/** The contents of a class definition during a period
1284
1284
*/
1285
- trait ClassDenotation extends SymDenotation {
1285
+ class ClassDenotation private [SymDenotations ] (
1286
+ symbol : Symbol ,
1287
+ maybeOwner : Symbol ,
1288
+ name : Name ,
1289
+ initFlags : FlagSet ,
1290
+ initInfo : Type ,
1291
+ initPrivateWithin : Symbol )
1292
+ extends SymDenotation (symbol, maybeOwner, name, initFlags, initInfo, initPrivateWithin) {
1286
1293
1287
1294
import util .LRUCache
1288
1295
@@ -1350,8 +1357,8 @@ object SymDenotations {
1350
1357
1351
1358
// ----- denotation fields and accessors ------------------------------
1352
1359
1353
- // if (initFlags is (Module, butNot = Package))
1354
- // assert(name.is(ModuleClassName), s"module naming inconsistency: ${name.debugString}")
1360
+ if (initFlags is (Module , butNot = Package ))
1361
+ assert(name.is(ModuleClassName ), s " module naming inconsistency: ${name.debugString}" )
1355
1362
1356
1363
/** The symbol asserted to have type ClassSymbol */
1357
1364
def classSymbol : ClassSymbol = symbol.asInstanceOf [ClassSymbol ]
@@ -1803,7 +1810,14 @@ object SymDenotations {
1803
1810
/** The denotation of a package class.
1804
1811
* It overrides ClassDenotation to take account of package objects when looking for members
1805
1812
*/
1806
- trait PackageClassDenotation extends ClassDenotation {
1813
+ final class PackageClassDenotation private [SymDenotations ] (
1814
+ symbol : Symbol ,
1815
+ ownerIfExists : Symbol ,
1816
+ name : Name ,
1817
+ initFlags : FlagSet ,
1818
+ initInfo : Type ,
1819
+ initPrivateWithin : Symbol )
1820
+ extends ClassDenotation (symbol, ownerIfExists, name, initFlags, initInfo, initPrivateWithin) {
1807
1821
1808
1822
private [this ] var packageObjCache : SymDenotation = _
1809
1823
private [this ] var packageObjRunId : RunId = NoRunId
0 commit comments