File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -351,10 +351,9 @@ object Splicer {
351351 throw new StopInterpretation (sw.toString, pos)
352352 case ex : InvocationTargetException =>
353353 ex.getTargetException match {
354- case targetException : NoClassDefFoundError => // FIXME check that the class is beeining compiled now
355- val className = targetException.getMessage
354+ case ClassDefinedInCurrentRun (sym) =>
356355 if (ctx.settings.XprintSuspension .value)
357- ctx.echo(i " suspension triggered by NoClassDefFoundError( $className ) " , pos) // TODO improve message
356+ ctx.echo(i " suspension triggered by a dependency on $sym " , pos)
358357 ctx.compilationUnit.suspend() // this throws a SuspendException
359358 case targetException =>
360359 val sw = new StringWriter ()
@@ -372,6 +371,14 @@ object Splicer {
372371 }
373372 }
374373
374+ private object ClassDefinedInCurrentRun {
375+ def unapply (targetException : NoClassDefFoundError )(given ctx : Context ): Option [Symbol ] = {
376+ val className = targetException.getMessage
377+ val sym = ctx.base.staticRef(className.toTypeName).symbol
378+ if (sym.isDefinedInCurrentRun) Some (sym) else None
379+ }
380+ }
381+
375382 /** List of classes of the parameters of the signature of `sym` */
376383 private def paramsSig (sym : Symbol ): List [Class [? ]] = {
377384 def paramClass (param : Type ): Class [? ] = {
You can’t perform that action at this time.
0 commit comments