@@ -982,7 +982,7 @@ object Denotations {
982
982
final def first : SingleDenotation = this
983
983
final def last : SingleDenotation = this
984
984
985
- final def matches (other : SingleDenotation )(using Context ): Boolean =
985
+ def matches (other : SingleDenotation )(using Context ): Boolean =
986
986
val d = signature.matchDegree(other.signature)
987
987
988
988
d match
@@ -1013,13 +1013,16 @@ object Denotations {
1013
1013
end matches
1014
1014
1015
1015
def mapInherited (ownDenots : PreDenotation , prevDenots : PreDenotation , pre : Type )(using Context ): SingleDenotation =
1016
- if (hasUniqueSym && prevDenots.containsSym(symbol)) NoDenotation
1017
- else if (isType) filterDisjoint(ownDenots).asSeenFrom(pre)
1018
- else asSeenFrom(pre).filterDisjoint(ownDenots)
1016
+ if hasUniqueSym && (symbol.is(Private ) || prevDenots.containsSym(symbol)) then
1017
+ NoDenotation
1018
+ else if isType then
1019
+ filterDisjoint(ownDenots).asSeenFrom(pre)
1020
+ else
1021
+ asSeenFrom(pre).filterDisjoint(ownDenots)
1019
1022
1020
- final def filterWithPredicate (p : SingleDenotation => Boolean ): SingleDenotation =
1023
+ def filterWithPredicate (p : SingleDenotation => Boolean ): SingleDenotation =
1021
1024
if (p(this )) this else NoDenotation
1022
- final def filterDisjoint (denots : PreDenotation )(using Context ): SingleDenotation =
1025
+ def filterDisjoint (denots : PreDenotation )(using Context ): SingleDenotation =
1023
1026
if (denots.exists && denots.matches(this )) NoDenotation else this
1024
1027
def filterWithFlags (required : FlagSet , excluded : FlagSet )(using Context ): SingleDenotation =
1025
1028
if (required.isEmpty && excluded.isEmpty || compatibleWith(required, excluded)) this else NoDenotation
0 commit comments