Skip to content

Commit c326d15

Browse files
committed
Print stack traces before creating stub symbols
1 parent 14d20d9 commit c326d15

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,11 @@ object Denotations {
193193
*/
194194
def requiredSymbol(p: Symbol => Boolean, source: AbstractFile = null, generateStubs: Boolean = true)(implicit ctx: Context): Symbol =
195195
disambiguate(p) match {
196-
case MissingRef(ownerd, name) =>
197-
if (generateStubs)
196+
case m @ MissingRef(ownerd, name) =>
197+
if (generateStubs) {
198+
m.ex.printStackTrace()
198199
ctx.newStubSymbol(ownerd.symbol, name, source)
200+
}
199201
else NoSymbol
200202
case NoDenotation | _: NoQualifyingRef =>
201203
throw new TypeError(s"None of the alternatives of $this satisfies required predicate")
@@ -858,7 +860,9 @@ object Denotations {
858860
/** An error denotation that provides more info about the missing reference.
859861
* Produced by staticRef, consumed by requiredSymbol.
860862
*/
861-
case class MissingRef(val owner: SingleDenotation, name: Name)(implicit ctx: Context) extends ErrorDenotation
863+
case class MissingRef(val owner: SingleDenotation, name: Name)(implicit ctx: Context) extends ErrorDenotation {
864+
val ex: Exception = new Exception
865+
}
862866

863867
/** An error denotation that provides more info about alternatives
864868
* that were found but that do not qualify.

src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
405405
// println(owner.info.decls.toList.map(_.debugString).mkString("\n ")) // !!! DEBUG
406406
// }
407407
// (5) Create a stub symbol to defer hard failure a little longer.
408+
new Exception().printStackTrace()
408409
ctx.newStubSymbol(owner, name, source)
409410
}
410411
}

0 commit comments

Comments
 (0)