@@ -257,11 +257,7 @@ object Denotations {
257
257
def checkUnique (using Context ): SingleDenotation = suchThat(alwaysTrue)
258
258
259
259
/** Does this denotation have an alternative that satisfies the predicate `p`? */
260
- inline def hasAltWith (inline p : SingleDenotation => Boolean ): Boolean =
261
- def p1 (x : SingleDenotation ) = p(x)
262
- this match
263
- case d : SingleDenotation => exists && p1(d)
264
- case _ => filterWithPredicate(p1).exists
260
+ def hasAltWith (p : SingleDenotation => Boolean ): Boolean
265
261
266
262
/** The denotation made up from the alternatives of this denotation that
267
263
* are accessible from prefix `pre`, or NoDenotation if no accessible alternative exists.
@@ -608,6 +604,9 @@ object Denotations {
608
604
def suchThat (p : Symbol => Boolean )(using Context ): SingleDenotation =
609
605
if (exists && p(symbol)) this else NoDenotation
610
606
607
+ def hasAltWith (p : SingleDenotation => Boolean ): Boolean =
608
+ exists && p(this )
609
+
611
610
def accessibleFrom (pre : Type , superAccess : Boolean )(using Context ): Denotation =
612
611
if (! symbol.exists || symbol.isAccessibleFrom(pre, superAccess)) this else NoDenotation
613
612
@@ -1186,6 +1185,8 @@ object Denotations {
1186
1185
}
1187
1186
override def filterWithPredicate (p : SingleDenotation => Boolean ): Denotation =
1188
1187
derivedUnionDenotation(denot1.filterWithPredicate(p), denot2.filterWithPredicate(p))
1188
+ def hasAltWith (p : SingleDenotation => Boolean ): Boolean =
1189
+ denot1.hasAltWith(p) || denot2.hasAltWith(p)
1189
1190
def accessibleFrom (pre : Type , superAccess : Boolean )(using Context ): Denotation = {
1190
1191
val d1 = denot1 accessibleFrom (pre, superAccess)
1191
1192
val d2 = denot2 accessibleFrom (pre, superAccess)
0 commit comments