Skip to content

Commit

Permalink
bugfix: Catch exception from the compiler for broken shadowed pickles
Browse files Browse the repository at this point in the history
Fixed in Metals: scalameta/metals#5586

[Cherry-picked fa54869]
  • Loading branch information
tgodzik authored and WojciechMazur committed Jun 19, 2024
1 parent 5c072ca commit a7b8f10
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class CompilerSearchVisitor(
private def isAccessible(sym: Symbol): Boolean = try
sym != NoSymbol && sym.isPublic && sym.isStatic
catch
case err: AssertionError =>
logger.log(Level.WARNING, err.getMessage())
false
case NonFatal(e) =>
reports.incognito.create(
Report(
Expand Down Expand Up @@ -64,8 +67,14 @@ class CompilerSearchVisitor(
.stripSuffix("$")
.split("\\$")

val added = toSymbols(pkg, innerPath.toList).filter(visitSymbol)
val added =
try toSymbols(pkg, innerPath.toList).filter(visitSymbol)
catch
case NonFatal(e) =>
logger.log(Level.WARNING, e.getMessage(), e)
Nil
added.size
end visitClassfile

def visitWorkspaceSymbol(
path: java.nio.file.Path,
Expand Down

0 comments on commit a7b8f10

Please sign in to comment.