Skip to content

Commit 7bbaf9f

Browse files
committed
.
1 parent da4c0cc commit 7bbaf9f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,13 +715,17 @@ object Completion:
715715
* @param qual The argument to which the implicit conversion should be applied.
716716
* @return The set of types after `qual` implicit conversion.
717717
*/
718-
private def implicitConversionTargets(qual: tpd.Tree)(using Context): Set[SearchSuccess] = {
718+
private def implicitConversionTargets(qual: tpd.Tree)(using Context): Set[SearchSuccess] = try {
719719
val typer = ctx.typer
720720
val conversions = new typer.ImplicitSearch(defn.AnyType, qual, pos.span, Set.empty).allImplicits
721721

722722
interactiv.println(i"implicit conversion targets considered: ${conversions.toList}%, %")
723723
conversions
724-
}
724+
} catch case NonFatal(ex) =>
725+
logger.warning(
726+
s"Exception when searching for implicit conversions:\n ${ex.getMessage()}\n${ex.getStackTrace().mkString("\n")}"
727+
)
728+
Set.empty
725729

726730
/** Filter for names that should appear when looking for completions. */
727731
private object completionsFilter extends NameFilter:

0 commit comments

Comments
 (0)