@@ -498,7 +498,7 @@ object SymDenotations {
498
498
/** `fullName` where `.' is the separator character */
499
499
def fullName (using Context ): Name = fullNameSeparated(QualifiedName )
500
500
501
- private var myTargetName : Name = null
501
+ private var myTargetName : Name | Null = null
502
502
503
503
private def computeTargetName (targetNameAnnot : Option [Annotation ])(using Context ): Name =
504
504
targetNameAnnot match
@@ -529,9 +529,9 @@ object SymDenotations {
529
529
else carrier.getAnnotation(defn.TargetNameAnnot )
530
530
myTargetName = computeTargetName(targetNameAnnot)
531
531
if name.is(SuperAccessorName ) then
532
- myTargetName = myTargetName.unmangle(List (ExpandedName , SuperAccessorName , ExpandPrefixName ))
532
+ myTargetName = myTargetName.nn. unmangle(List (ExpandedName , SuperAccessorName , ExpandPrefixName ))
533
533
534
- myTargetName
534
+ myTargetName.nn
535
535
536
536
// ----- Tests -------------------------------------------------
537
537
@@ -834,7 +834,7 @@ object SymDenotations {
834
834
* As a side effect, drop Local flags of members that are not accessed via the ThisType
835
835
* of their owner.
836
836
*/
837
- final def isAccessibleFrom (pre : Type , superAccess : Boolean = false , whyNot : StringBuffer = null )(using Context ): Boolean = {
837
+ final def isAccessibleFrom (pre : Type , superAccess : Boolean = false , whyNot : StringBuffer | Null = null )(using Context ): Boolean = {
838
838
839
839
/** Are we inside definition of `boundary`?
840
840
* If this symbol is Java defined, package structure is interpreted to be flat.
@@ -864,7 +864,7 @@ object SymDenotations {
864
864
/** Is protected access to target symbol permitted? */
865
865
def isProtectedAccessOK : Boolean =
866
866
inline def fail (str : String ): false =
867
- if whyNot != null then whyNot.append(str)
867
+ if whyNot != null then whyNot.nn. append(str)
868
868
false
869
869
val cls = owner.enclosingSubClass
870
870
if ! cls.exists then
@@ -1240,7 +1240,7 @@ object SymDenotations {
1240
1240
.map(tpd.definedSym)
1241
1241
.find(_.name == name)
1242
1242
.getOrElse(NoSymbol )
1243
- else if (ctx.scope == null )
1243
+ else if (( ctx.scope: Scope | Null ) == null ) // TODO
1244
1244
NoSymbol
1245
1245
else if (ctx.scope.lookup(this .name) == symbol)
1246
1246
ctx.scope.lookup(name)
@@ -1534,10 +1534,10 @@ object SymDenotations {
1534
1534
owner : Symbol = this .owner,
1535
1535
name : Name = this .name,
1536
1536
initFlags : FlagSet = UndefinedFlags ,
1537
- info : Type = null ,
1538
- privateWithin : Symbol = null ,
1539
- annotations : List [Annotation ] = null ,
1540
- rawParamss : List [List [Symbol ]] = null )(
1537
+ info : Type | Null = null ,
1538
+ privateWithin : Symbol | Null = null ,
1539
+ annotations : List [Annotation ] | Null = null ,
1540
+ rawParamss : List [List [Symbol ]] | Null = null )(
1541
1541
using Context ): SymDenotation = {
1542
1542
// simulate default parameters, while also passing implicit context ctx to the default values
1543
1543
val initFlags1 = (if (initFlags != UndefinedFlags ) initFlags else this .flags)
@@ -1562,7 +1562,7 @@ object SymDenotations {
1562
1562
/** Are `info1` and `info2` ClassInfo types with different parents?
1563
1563
* @param completersMatter if `true`, consider parents changed if `info1` or `info2 `is a type completer
1564
1564
*/
1565
- protected def changedClassParents (info1 : Type , info2 : Type , completersMatter : Boolean ): Boolean =
1565
+ protected def changedClassParents (info1 : Type | Null , info2 : Type | Null , completersMatter : Boolean ): Boolean =
1566
1566
info2 match {
1567
1567
case info2 : ClassInfo =>
1568
1568
info1 match {
@@ -1704,15 +1704,15 @@ object SymDenotations {
1704
1704
1705
1705
// ----- caches -------------------------------------------------------
1706
1706
1707
- private var myTypeParams : List [TypeSymbol ] = null
1707
+ private var myTypeParams : List [TypeSymbol ] | Null = null
1708
1708
private var fullNameCache : SimpleIdentityMap [QualifiedNameKind , Name ] = SimpleIdentityMap .empty
1709
1709
1710
- private var myMemberCache : EqHashMap [Name , PreDenotation ] = null
1710
+ private var myMemberCache : EqHashMap [Name , PreDenotation ] | Null = null
1711
1711
private var myMemberCachePeriod : Period = Nowhere
1712
1712
1713
1713
/** A cache from types T to baseType(T, C) */
1714
1714
type BaseTypeMap = EqHashMap [CachedType , Type ]
1715
- private var myBaseTypeCache : BaseTypeMap = null
1715
+ private var myBaseTypeCache : BaseTypeMap | Null = null
1716
1716
private var myBaseTypeCachePeriod : Period = Nowhere
1717
1717
1718
1718
private var baseDataCache : BaseData = BaseData .None
@@ -1753,7 +1753,7 @@ object SymDenotations {
1753
1753
invalidateMemberNamesCache()
1754
1754
1755
1755
def invalidateMemberCachesFor (sym : Symbol )(using Context ): Unit =
1756
- if myMemberCache != null then myMemberCache.remove(sym.name)
1756
+ if myMemberCache != null then myMemberCache.uncheckedNN. remove(sym.name)
1757
1757
if ! sym.flagsUNSAFE.is(Private ) then
1758
1758
invalidateMemberNamesCache()
1759
1759
if sym.isWrappedToplevelDef then
0 commit comments