From c326d15bce108459371567069a7ecbc38388fb84 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Fri, 23 Oct 2015 13:59:48 +0200 Subject: Print stack traces before creating stub symbols --- src/dotty/tools/dotc/core/Denotations.scala | 10 +++++++--- src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core') diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index bd03cc056..65df55a9d 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -193,9 +193,11 @@ object Denotations { */ def requiredSymbol(p: Symbol => Boolean, source: AbstractFile = null, generateStubs: Boolean = true)(implicit ctx: Context): Symbol = disambiguate(p) match { - case MissingRef(ownerd, name) => - if (generateStubs) + case m @ MissingRef(ownerd, name) => + if (generateStubs) { + m.ex.printStackTrace() ctx.newStubSymbol(ownerd.symbol, name, source) + } else NoSymbol case NoDenotation | _: NoQualifyingRef => throw new TypeError(s"None of the alternatives of $this satisfies required predicate") @@ -858,7 +860,9 @@ object Denotations { /** An error denotation that provides more info about the missing reference. * Produced by staticRef, consumed by requiredSymbol. */ - case class MissingRef(val owner: SingleDenotation, name: Name)(implicit ctx: Context) extends ErrorDenotation + case class MissingRef(val owner: SingleDenotation, name: Name)(implicit ctx: Context) extends ErrorDenotation { + val ex: Exception = new Exception + } /** An error denotation that provides more info about alternatives * that were found but that do not qualify. diff --git a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index af33ce3c2..6e405d5f8 100644 --- a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -405,6 +405,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas // println(owner.info.decls.toList.map(_.debugString).mkString("\n ")) // !!! DEBUG // } // (5) Create a stub symbol to defer hard failure a little longer. + new Exception().printStackTrace() ctx.newStubSymbol(owner, name, source) } } -- cgit v1.2.3