Skip to content

Commit e2a5290

Browse files
committed
Refix WorksheetTest.evaluationException
1 parent 6ef28df commit e2a5290

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/repl/Rendering.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,14 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None):
165165
Nil
166166
try load()
167167
catch
168-
case e: ExceptionInInitializerError => List(renderError(e.getCause, sym.denot))
168+
case e: ExceptionInInitializerError => List(renderError(e, sym.denot))
169169
case NonFatal(e) => List(renderError(e, sym.denot))
170170

171171
/** Render the stack trace of the underlying exception. */
172-
def renderError(cause: Throwable, d: Denotation)(using Context): Diagnostic =
172+
def renderError(thr: Throwable, d: Denotation)(using Context): Diagnostic =
173+
val cause = thr.getCause match
174+
case e: ExceptionInInitializerError => e.getCause
175+
case e => e
173176
// detect
174177
//at repl$.rs$line$2$.<clinit>(rs$line$2:1)
175178
//at repl$.rs$line$2.res1(rs$line$2)

0 commit comments

Comments
 (0)