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 {
351
351
throw new StopInterpretation (sw.toString, pos)
352
352
case ex : InvocationTargetException =>
353
353
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) =>
356
355
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)
358
357
ctx.compilationUnit.suspend() // this throws a SuspendException
359
358
case targetException =>
360
359
val sw = new StringWriter ()
@@ -372,6 +371,14 @@ object Splicer {
372
371
}
373
372
}
374
373
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
+
375
382
/** List of classes of the parameters of the signature of `sym` */
376
383
private def paramsSig (sym : Symbol ): List [Class [? ]] = {
377
384
def paramClass (param : Type ): Class [? ] = {
You can’t perform that action at this time.
0 commit comments