@@ -474,12 +474,6 @@ object Denotations {
474
474
if (matches) this else NoDenotation
475
475
}
476
476
477
- def matches (other : SingleDenotation )(implicit ctx : Context ): Boolean = {
478
- val d = signature.matchDegree(other.signature)
479
- d == Signature .FullMatch ||
480
- d >= Signature .ParamMatch && info.matches(other.info)
481
- }
482
-
483
477
// ------ Forming types -------------------------------------------
484
478
485
479
/** The TypeRef representing this type denotation at its original location. */
@@ -786,12 +780,15 @@ object Denotations {
786
780
final def last = this
787
781
final def toDenot (pre : Type )(implicit ctx : Context ): Denotation = this
788
782
final def containsSym (sym : Symbol ): Boolean = hasUniqueSym && (symbol eq sym)
789
- final def containsSig (sig : Signature )(implicit ctx : Context ) =
790
- exists && signature.matchDegree(sig) >= Signature .ParamMatch
783
+ final def matches (other : SingleDenotation )(implicit ctx : Context ): Boolean = {
784
+ val d = signature.matchDegree(other.signature)
785
+ d == Signature .FullMatch ||
786
+ d >= Signature .ParamMatch && info.matches(other.info)
787
+ }
791
788
final def filterWithPredicate (p : SingleDenotation => Boolean ): SingleDenotation =
792
789
if (p(this )) this else NoDenotation
793
790
final def filterDisjoint (denots : PreDenotation )(implicit ctx : Context ): SingleDenotation =
794
- if (denots.exists && denots.containsSig(signature )) NoDenotation else this
791
+ if (denots.exists && denots.matches( this )) NoDenotation else this
795
792
def mapInherited (ownDenots : PreDenotation , prevDenots : PreDenotation , pre : Type )(implicit ctx : Context ): SingleDenotation =
796
793
if (hasUniqueSym && prevDenots.containsSym(symbol)) NoDenotation
797
794
else if (isType) filterDisjoint(ownDenots).asSeenFrom(pre)
@@ -880,7 +877,7 @@ object Denotations {
880
877
def containsSym (sym : Symbol ): Boolean
881
878
882
879
/** Group contains a denotation with given signature */
883
- def containsSig ( sig : Signature )(implicit ctx : Context ): Boolean
880
+ def matches ( other : SingleDenotation )(implicit ctx : Context ): Boolean
884
881
885
882
/** Keep only those denotations in this group which satisfy predicate `p`. */
886
883
def filterWithPredicate (p : SingleDenotation => Boolean ): PreDenotation
@@ -941,8 +938,8 @@ object Denotations {
941
938
(denots1 toDenot pre) & (denots2 toDenot pre, pre)
942
939
def containsSym (sym : Symbol ) =
943
940
(denots1 containsSym sym) || (denots2 containsSym sym)
944
- def containsSig ( sig : Signature )(implicit ctx : Context ) =
945
- ( denots1 containsSig sig ) || ( denots2 containsSig sig )
941
+ def matches ( other : SingleDenotation )(implicit ctx : Context ): Boolean =
942
+ denots1.matches(other ) || denots2.matches(other )
946
943
def filterWithPredicate (p : SingleDenotation => Boolean ): PreDenotation =
947
944
derivedUnion(denots1 filterWithPredicate p, denots2 filterWithPredicate p)
948
945
def filterDisjoint (denots : PreDenotation )(implicit ctx : Context ): PreDenotation =
0 commit comments