Skip to content

Commit 11473bd

Browse files
tgodzikWojciechMazur
authored andcommitted
bugfix: Catch exception from the compiler for broken shadowed pickles
Fixed in Metals: scalameta/metals#5586 [Cherry-picked fa54869]
1 parent 84fca0f commit 11473bd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

presentation-compiler/src/main/dotty/tools/pc/CompilerSearchVisitor.scala

+10-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class CompilerSearchVisitor(
2222
private def isAccessible(sym: Symbol): Boolean = try
2323
sym != NoSymbol && sym.isPublic && sym.isStatic
2424
catch
25+
case err: AssertionError =>
26+
logger.log(Level.WARNING, err.getMessage())
27+
false
2528
case NonFatal(e) =>
2629
reports.incognito.create(
2730
Report(
@@ -64,8 +67,14 @@ class CompilerSearchVisitor(
6467
.stripSuffix("$")
6568
.split("\\$")
6669

67-
val added = toSymbols(pkg, innerPath.toList).filter(visitSymbol)
70+
val added =
71+
try toSymbols(pkg, innerPath.toList).filter(visitSymbol)
72+
catch
73+
case NonFatal(e) =>
74+
logger.log(Level.WARNING, e.getMessage(), e)
75+
Nil
6876
added.size
77+
end visitClassfile
6978

7079
def visitWorkspaceSymbol(
7180
path: java.nio.file.Path,

0 commit comments

Comments
 (0)