@@ -445,7 +445,6 @@ object RefChecks {
445
445
446
446
// todo: align accessibility implication checking with isAccessible in Contexts
447
447
def isOverrideAccessOK =
448
- val memberIsPublic = (member.flags & AccessFlags ).isEmpty && ! member.privateWithin.exists
449
448
def protectedOK = ! other.is(Protected ) || member.is(Protected ) // if o is protected, so is m
450
449
def accessBoundaryOK =
451
450
val ob = other.accessBoundary(member.owner)
@@ -454,7 +453,7 @@ object RefChecks {
454
453
def companionBoundaryOK = ob.isClass && ! ob.isLocalToBlock && mb.is(Module ) && (ob.companionModule eq mb.companionModule)
455
454
ob.isContainedIn(mb) || companionBoundaryOK // m relaxes o's access boundary,
456
455
def otherIsJavaProtected = other.isAllOf(JavaProtected ) // or o is Java defined and protected (see #3946)
457
- memberIsPublic || protectedOK && (accessBoundaryOK || otherIsJavaProtected)
456
+ member.isPublic || protectedOK && (accessBoundaryOK || otherIsJavaProtected)
458
457
end isOverrideAccessOK
459
458
460
459
if ! member.hasTargetName(other.targetName) then
@@ -1069,16 +1068,18 @@ object RefChecks {
1069
1068
target.nonPrivateMember(sym.name)
1070
1069
.filterWithPredicate:
1071
1070
member =>
1072
- val memberIsImplicit = member.info.hasImplicitParams
1073
- val paramTps =
1074
- if memberIsImplicit then methTp.stripPoly.firstParamTypes
1075
- else methTp.firstExplicitParamTypes
1076
-
1077
- paramTps.isEmpty || memberIsImplicit && ! methTp.hasImplicitParams || {
1078
- val memberParamTps = member.info.stripPoly.firstParamTypes
1079
- ! memberParamTps.isEmpty
1080
- && memberParamTps.lengthCompare(paramTps) == 0
1081
- && memberParamTps.lazyZip(paramTps).forall((m, x) => x frozen_<:< m)
1071
+ member.symbol.isPublic && {
1072
+ val memberIsImplicit = member.info.hasImplicitParams
1073
+ val paramTps =
1074
+ if memberIsImplicit then methTp.stripPoly.firstParamTypes
1075
+ else methTp.firstExplicitParamTypes
1076
+
1077
+ paramTps.isEmpty || memberIsImplicit && ! methTp.hasImplicitParams || {
1078
+ val memberParamTps = member.info.stripPoly.firstParamTypes
1079
+ ! memberParamTps.isEmpty
1080
+ && memberParamTps.lengthCompare(paramTps) == 0
1081
+ && memberParamTps.lazyZip(paramTps).forall((m, x) => x frozen_<:< m)
1082
+ }
1082
1083
}
1083
1084
.exists
1084
1085
if ! target.typeSymbol.denot.isAliasType && ! target.typeSymbol.denot.isOpaqueAlias && hidden
0 commit comments