Skip to content

Commit b1f42a6

Browse files
committed
Print yet more info to find Heisenbugs.
1 parent bc2d129 commit b1f42a6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,23 @@ object Denotations {
205205
denot.symbol
206206
}
207207

208+
def slowSearch(name: Name)(implicit ctx: Context): Symbol =
209+
info.decls.find(_.name == name).getOrElse(NoSymbol)
210+
208211
def requiredMethod(name: PreName)(implicit ctx: Context): TermSymbol =
209212
if (info.exists) {
210213
val meth = info.member(name.toTermName)
211214
if (meth.exists) meth.requiredSymbol(_ is Method).asTerm
212215
else { // Heisenbughunt
213-
println(s"*** missing method: $name in $this")
214-
println(info.decls)
216+
println(s"*** missing method: ${name.toString} in $this")
217+
info.decls.checkConsistent()
218+
println(i"decls = ${info.decls}")
219+
if (slowSearch(name.toTermName).exists)
220+
System.err.println(i"**** slow search found: ${slowSearch(name.toTermName)}")
215221
throw new TypeError(s"Missing method: $this . $name")
216222
}
217223
}
218-
else throw new TypeError(s"Missing module: $this")
224+
else throw new TypeError(s"M issing module: $this")
219225

220226
def requiredMethodRef(name: PreName)(implicit ctx: Context): TermRef =
221227
requiredMethod(name).termRef

0 commit comments

Comments
 (0)