Skip to content

Commit 46a96c0

Browse files
Backport "bugfix: Catch exception from the compiler for broken shadowed pickles" to LTS (#20611)
Backports #18502 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents 5c072ca + a7b8f10 commit 46a96c0

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)