Skip to content

Commit 0f92534

Browse files
committed
More info to trouble-shoot Heisenbugs
Trouble shoot the case of the missing newRefArray method.
1 parent ff6f2e7 commit 0f92534

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,22 @@ object Denotations {
208208
def slowSearch(name: Name)(implicit ctx: Context): Symbol =
209209
info.decls.find(_.name == name).getOrElse(NoSymbol)
210210

211-
def requiredMethod(name: PreName)(implicit ctx: Context): TermSymbol =
211+
def requiredMethod(pname: PreName)(implicit ctx: Context): TermSymbol =
212212
if (info.exists) {
213-
val meth = info.member(name.toTermName)
213+
val name = pname.toTermName
214+
val meth = info.member(name)
214215
if (meth.exists) meth.requiredSymbol(_ is Method).asTerm
215216
else { // Heisenbughunt
216-
println(s"*** missing method: ${name.toString} in $this")
217+
println(s"*** missing method: $name in $this")
218+
val own = info.decl(name)
219+
if (own.exists) {
220+
println(i"decl succeeded: $own")
221+
return own.requiredSymbol(_ is Method).asTerm
222+
}
217223
info.decls.checkConsistent()
218224
println(i"decls = ${info.decls}")
219225
if (slowSearch(name.toTermName).exists) {
220-
System.err.println(i"**** slow search found: ${slowSearch(name.toTermName)}")
226+
System.err.println(i"**** slow search found: ${slowSearch(name)}")
221227
System.err.println("scope entries found:")
222228
var e = info.decls.lastEntry
223229
while (e != null) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ object SymDenotations {
15141514
if (denots == null) {
15151515
denots = computeNPMembersNamed(name, inherited)
15161516
if (isFullyCompleted) memberCache.enter(name, denots)
1517-
} else if (Config.checkCacheMembersNamed) {
1517+
} else if (Config.checkCacheMembersNamed || name.toString == "newRefArray") {
15181518
val denots1 = computeNPMembersNamed(name, inherited)
15191519
assert(denots.exists == denots1.exists, s"cache inconsistency: cached: $denots, computed $denots1, name = $name, owner = $this")
15201520
}

0 commit comments

Comments
 (0)