Skip to content

Commit 86dd9ea

Browse files
committed
Fix build problem
1 parent d2a7ce1 commit 86dd9ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/interactive/Interactive.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ object Interactive {
6262
sourceSymbol(sym.owner)
6363
else sym
6464

65-
private def safely[T](default: T)(op: => T) =
66-
try op catch { case ex: TypeError => default }
65+
private def safely[T](op: => List[T]): List[T] =
66+
try op catch { case ex: TypeError => Nil }
6767

6868
/** Possible completions at position `pos` */
6969
def completions(trees: List[SourceTree], pos: SourcePosition)(implicit ctx: Context): List[Symbol] = {
@@ -89,7 +89,7 @@ object Interactive {
8989

9090
/** Possible completions of members of `prefix` which are accessible when called inside `boundary` */
9191
def completions(prefix: Type, boundary: Symbol)(implicit ctx: Context): List[Symbol] =
92-
safely(Nil) {
92+
safely {
9393
val boundaryCtx = ctx.withOwner(boundary)
9494
prefix.memberDenots(completionsFilter, (name, buf) =>
9595
buf ++= prefix.member(name).altsWith(d => !d.isAbsent && d.symbol.isAccessibleFrom(prefix)(boundaryCtx))
@@ -131,7 +131,7 @@ object Interactive {
131131
* @param includeReferences If true, include references and not just definitions
132132
*/
133133
def namedTrees(trees: List[SourceTree], includeReferences: Boolean, treePredicate: NameTree => Boolean)
134-
(implicit ctx: Context): List[SourceTree] = safely(Nil) {
134+
(implicit ctx: Context): List[SourceTree] = safely {
135135
val buf = new mutable.ListBuffer[SourceTree]
136136

137137
trees foreach { case SourceTree(topTree, source) =>

0 commit comments

Comments
 (0)