@@ -272,7 +272,7 @@ object Symbols {
272
272
val d = denot
273
273
d.owner match
274
274
case owner : ClassSymbol =>
275
- if owner.is (Package ) then
275
+ if owner._is (Package ) then
276
276
d.validFor |= InitialPeriod
277
277
if d.is(Module ) then d.moduleClass.denot.validFor |= InitialPeriod
278
278
else
@@ -296,7 +296,7 @@ object Symbols {
296
296
atPhase(phase.next)(dropAfter(phase))
297
297
else
298
298
val d = denot
299
- assert(! d.owner.is (Package ))
299
+ assert(! d.owner._is (Package ))
300
300
d.owner.classDenot.ensureFreshScopeAfter(phase)
301
301
assert(isPrivate || phase.changesMembers, i " $_self deleted in ${d.owner} at undeclared phase $phase" )
302
302
drop()
@@ -362,7 +362,7 @@ object Symbols {
362
362
d.moduleClass.sourceSymbol // The module val always has a zero-extent position
363
363
else if d.is(Synthetic ) then
364
364
val linked = d.linkedClass
365
- if linked.exists && ! linked.is (Synthetic ) then linked
365
+ if linked.exists && ! linked._is (Synthetic ) then linked
366
366
else d.owner.sourceSymbol
367
367
else if d.isPrimaryConstructor then
368
368
d.owner.sourceSymbol
@@ -375,6 +375,7 @@ object Symbols {
375
375
def thisType (using Context ): Type = _self.denot.thisType
376
376
def typeRef (using Context ): TypeRef = _self.denot.typeRef
377
377
def termRef (using Context ): TermRef = _self.denot.termRef
378
+ def _info (using Context ): Type = _self.denot.info
378
379
def isCompleted (using Context ): Boolean = _self.denot.isCompleted
379
380
def isCompleting (using Context ): Boolean = _self.denot.isCompleting
380
381
def ensureCompleted ()(using Context ): Unit = _self.denot.ensureCompleted()
@@ -391,12 +392,12 @@ object Symbols {
391
392
def enclosingClass (using Context ): Symbol = _self.denot.enclosingClass
392
393
def enclosingMethod (using Context ): Symbol = _self.denot.enclosingMethod
393
394
def typeParamCreationFlags (using Context ): FlagSet = _self.denot.typeParamCreationFlags
394
- // def is (flag: Flag)(using Context): Boolean = _self.denot.is(flag)
395
- // def is (flag: Flag, butNot: FlagSet)(using Context): Boolean = _self.denot.is(flag, butNot)
396
- // def isOneOf (fs: FlagSet)(using Context): Boolean = _self.denot.isOneOf(fs)
397
- // def isOneOf (fs: FlagSet, butNot: FlagSet)(using Context): Boolean = _self.denot.isOneOf(fs, butNot)
398
- // def isAllOf (fs: FlagSet)(using Context): Boolean = _self.denot.isAllOf(fs)
399
- // def isAllOf (fs: FlagSet, butNot: FlagSet)(using Context): Boolean = _self.denot.isAllOf(fs, butNot)
395
+ def _is (flag : Flag )(using Context ): Boolean = _self.denot.is(flag)
396
+ def _is (flag : Flag , butNot : FlagSet )(using Context ): Boolean = _self.denot.is(flag, butNot)
397
+ def _isOneOf (fs : FlagSet )(using Context ): Boolean = _self.denot.isOneOf(fs)
398
+ def _isOneOf (fs : FlagSet , butNot : FlagSet )(using Context ): Boolean = _self.denot.isOneOf(fs, butNot)
399
+ def _isAllOf (fs : FlagSet )(using Context ): Boolean = _self.denot.isAllOf(fs)
400
+ def _isAllOf (fs : FlagSet , butNot : FlagSet )(using Context ): Boolean = _self.denot.isAllOf(fs, butNot)
400
401
// !!! Dotty problem: overloaded extension methods here lead to failures like
401
402
// Assertion failed: data race? overwriting method isAllOf with method isAllOf in type TermRef(TermRef(TermRef(ThisType(TypeRef(NoPrefix,module class dotc)),object core),object Symbols),isAllOf),
402
403
// |last sym id = 10301, new sym id = 10299,
@@ -513,7 +514,7 @@ object Symbols {
513
514
514
515
def sourceOfClass (using Context ): SourceFile =
515
516
val common = _self.lastKnownDenotation.common.asClass
516
- if ! common.source.exists && ! _self.is (Package ) then
517
+ if ! common.source.exists && ! _self._is (Package ) then
517
518
// this allows sources to be added in annotations after `sourceOfClass` is first called
518
519
val file = _self.associatedFile
519
520
if file != null && file.extension != " class" then
@@ -664,7 +665,7 @@ object Symbols {
664
665
owner, name, modFlags | ModuleValCreationFlags , NoCompleter , privateWithin, coord)
665
666
val modcls = newClassSymbol(
666
667
owner, modclsName, modclsFlags, infoFn(module, _), privateWithin, coord, assocFile)
667
- module.info =
668
+ module.denot. info =
668
669
if (modcls.isCompleted) TypeRef (owner.thisType, modcls)
669
670
else new ModuleCompleter (modcls)
670
671
module
@@ -756,7 +757,7 @@ object Symbols {
756
757
*/
757
758
def newStubSymbol (owner : Symbol , name : Name , file : AbstractFile | Null = null )(using Context ): Symbol = {
758
759
def stubCompleter = new StubInfo ()
759
- val normalizedOwner = if (owner.is (ModuleVal )) owner.moduleClass else owner
760
+ val normalizedOwner = if (owner._is (ModuleVal )) owner.moduleClass else owner
760
761
typr.println(s " creating stub for ${name.show}, owner = ${normalizedOwner.denot.debugString}, file = $file" )
761
762
typr.println(s " decls = ${normalizedOwner.unforcedDecls.toList.map(_.debugString).mkString(" \n " )}" ) // !!! DEBUG
762
763
// if (base.settings.debug.value) throw new Error()
@@ -838,7 +839,7 @@ object Symbols {
838
839
val tparams = tparamBuf.toList
839
840
val bounds = boundsFn(trefBuf.toList)
840
841
for (tparam, bound) <- tparams.lazyZip(bounds) do
841
- tparam.info = bound
842
+ tparam.denot. info = bound
842
843
tparams
843
844
}
844
845
@@ -861,7 +862,7 @@ object Symbols {
861
862
*/
862
863
def mapSymbols (originals : List [Symbol ], ttmap : TreeTypeMap , mapAlways : Boolean = false )(using Context ): List [Symbol ] =
863
864
if (originals.forall(sym =>
864
- (ttmap.mapType(sym.info ) eq sym.info ) &&
865
+ (ttmap.mapType(sym._info ) eq sym._info ) &&
865
866
! (ttmap.oldOwners contains sym.owner)) && ! mapAlways)
866
867
originals
867
868
else {
@@ -880,7 +881,7 @@ object Symbols {
880
881
881
882
def complete (denot : SymDenotation )(using Context ): Unit =
882
883
883
- val oinfo = original.info match
884
+ val oinfo = original._info match
884
885
case ClassInfo (pre, _, parents, decls, selfInfo) =>
885
886
assert(original.isClass)
886
887
val parents1 = parents.mapConserve(ttmap.mapType)
@@ -894,7 +895,7 @@ object Symbols {
894
895
val decls1 = newScope
895
896
val newTypeParams = mapSymbols(original.typeParams, ttmap1, mapAlways = true )
896
897
newTypeParams.foreach(decls1.enter)
897
- for sym <- decls do if ! sym.is (TypeParam ) then decls1.enter(sym)
898
+ for sym <- decls do if ! sym._is (TypeParam ) then decls1.enter(sym)
898
899
val parents2 = parents1.map(_.substSym(otypeParams, newTypeParams))
899
900
val selfInfo1 = selfInfo match
900
901
case selfInfo : Type => selfInfo.substSym(otypeParams, newTypeParams)
@@ -910,10 +911,10 @@ object Symbols {
910
911
911
912
end completer
912
913
913
- copy.info = completer
914
+ copy.denot. info = completer
914
915
copy.denot match
915
916
case cd : ClassDenotation =>
916
- cd.registeredCompanion = original.registeredCompanion.subst(originals, copies)
917
+ cd.registeredCompanion = original.denot. registeredCompanion.subst(originals, copies)
917
918
case _ =>
918
919
}
919
920
@@ -922,9 +923,9 @@ object Symbols {
922
923
// Update Child annotations of classes encountered previously to new values
923
924
// if some child is among the mapped symbols
924
925
for orig <- ttmap1.substFrom do
925
- if orig.is (Sealed ) && orig.children.exists(originals.contains) then
926
+ if orig._is (Sealed ) && orig.children.exists(originals.contains) then
926
927
val sealedCopy = orig.subst(ttmap1.substFrom, ttmap1.substTo)
927
- sealedCopy.annotations = sealedCopy.annotations.mapConserve(ttmap1.apply)
928
+ sealedCopy.denot. annotations = sealedCopy.denot .annotations.mapConserve(ttmap1.apply)
928
929
929
930
copies
930
931
}
@@ -949,7 +950,7 @@ object Symbols {
949
950
950
951
def requiredPackage (path : PreName )(using Context ): TermSymbol = {
951
952
val name = path.toTermName
952
- staticRef(name, isPackage = true ).requiredSymbol(" package" , name)(_.is (Package )).asTerm
953
+ staticRef(name, isPackage = true ).requiredSymbol(" package" , name)(_._is (Package )).asTerm
953
954
}
954
955
955
956
def requiredPackageRef (path : PreName )(using Context ): TermRef = requiredPackage(path).termRef
@@ -982,25 +983,25 @@ object Symbols {
982
983
*/
983
984
def getPackageClassIfDefined (path : PreName )(using Context ): Symbol =
984
985
staticRef(path.toTypeName, isPackage = true , generateStubs = false )
985
- .disambiguate(_ is PackageClass ).symbol
986
+ .disambiguate(_._is( PackageClass ) ).symbol
986
987
987
988
def requiredModule (path : PreName )(using Context ): TermSymbol = {
988
989
val name = path.toTermName
989
- staticRef(name).requiredSymbol(" object" , name)(_.is (Module )).asTerm
990
+ staticRef(name).requiredSymbol(" object" , name)(_._is (Module )).asTerm
990
991
}
991
992
992
993
/** Get module symbol if the module is either defined in current compilation run
993
994
* or present on classpath. Returns NoSymbol otherwise.
994
995
*/
995
996
def getModuleIfDefined (path : PreName )(using Context ): Symbol =
996
997
staticRef(path.toTermName, generateStubs = false )
997
- .disambiguate(_.is (Module )).symbol
998
+ .disambiguate(_._is (Module )).symbol
998
999
999
1000
def requiredModuleRef (path : PreName )(using Context ): TermRef = requiredModule(path).termRef
1000
1001
1001
1002
def requiredMethod (path : PreName )(using Context ): TermSymbol = {
1002
1003
val name = path.toTermName
1003
- staticRef(name).requiredSymbol(" method" , name)(_.is (Method )).asTerm
1004
+ staticRef(name).requiredSymbol(" method" , name)(_._is (Method )).asTerm
1004
1005
}
1005
1006
1006
1007
def requiredMethodRef (path : PreName )(using Context ): TermRef = requiredMethod(path).termRef
0 commit comments