I'm tracing a bizarre regression in Erasure. I found the change that triggered it, but I think the real issue is somewhere else.
This rather low-level scope walking code in erasure:
private def checkNoDeclaredDoubleDefs(base: Symbol) {
val decls = base.info.decls
var e = decls.elems
while (e ne null) {
if (e.sym.isTerm) {
var e1 = decls lookupNextEntry e
while (e1 ne null) {
if (sameTypeAfterErasure(e.sym, e1.sym))
doubleDefError(new SymbolPair(base, e.sym, e1.sym))
e1 = decls lookupNextEntry e1
}
}
e = e.next
}
}
... runs into a situation where `e eq e2`.
Below, I show the internal structure of `decls`, and the internal structure of a new scope with the same elements (_1 and _2 respectively.) In both of these scopes, decls.toList does not return duplicates.
Is this Scope indeed corrupt? What invariant is broken? I would like to add `Scope.validate()` and call that after any Scope mutation (though that might be too expensive to leave enabled) to determine from whence the corruption stems.
Thanks,
-jason