Skip to content

Commit 84ccfc7

Browse files
committed
Fix Scope.exists
1 parent 5f28215 commit 84ccfc7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/Scopes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ object Scopes {
106106
}
107107

108108
/** Tests whether a predicate holds for at least one Symbol of this Scope. */
109-
def exists(p: Symbol => Boolean)(implicit ctx: Context): Boolean = filter(p).isEmpty
109+
def exists(p: Symbol => Boolean)(implicit ctx: Context): Boolean = filter(p).nonEmpty
110110

111111
/** Finds the first Symbol of this Scope satisfying a predicate, if any. */
112112
def find(p: Symbol => Boolean)(implicit ctx: Context): Symbol = filter(p) match {

compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class YCheckPositions extends Phases.Phase {
5858

5959
private def isMacro(call: Tree)(implicit ctx: Context) = {
6060
if (ctx.phase <= ctx.typerPhase.next) call.symbol.is(Macro)
61-
else (call.symbol.unforcedDecls.exists(_.is(Macro)) || call.symbol.unforcedDecls.toList.exists(_.is(Macro)))
61+
else (call.symbol.unforcedDecls.isEmpty /* bug from exists */ || call.symbol.unforcedDecls.exists(_.is(Macro)) || call.symbol.unforcedDecls.toList.exists(_.is(Macro)))
6262
}
6363

6464
}

0 commit comments

Comments
 (0)