Github user rcsenkbeil commented on the pull request:
https://github.com/apache/spark/pull/1929#issuecomment-53377066
I've been fiddling around in the debugger to try to see if I can pinpoint
what occurs during a compile error that would affect the state of Global,
considering a new Run instance is being created per interpret call. I have
noticed that the _reportCompileErrors_ of the Global#Run class does some
reseting:
```
def reportCompileErrors() {
if (reporter.hasErrors) {
for ((sym, file) <- symSource.iterator) {
sym.reset(new loaders.SourcefileLoader(file))
if (sym.isTerm)
sym.moduleClass reset loaders.moduleClassLoader
}
}
else {
allConditionalWarnings foreach (_.summarize)
if (seenMacroExpansionsFallingBack)
warning("some macros could not be expanded and code fell back to
overridden methods;"+
"\nrecompiling with generated classfiles on the classpath
might help.")
// todo: migrationWarnings
}
}
```
While the symSource is local to the Run instance, I'm not sure if these
resets would affect something in Global. I was trying to bypass the resets by
setting a breakpoint on the `if (reporter.hasErrors) {` line and executing
`reporter.reset()` to alter the state before entering the block. That ended up
giving me the compile errors that we've seen with `new test.Test`, but I'm not
sure if my attempt really proved that this chunk of code is the
culprit/solution.
Also, based on your comment about only symbol-not-found errors, I was at
least able to trigger this compile error to also load a Scala class:

---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]