diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-23 07:30:21 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-23 08:06:02 -0800 |
commit | ec3438c28987a38a3c03ebb5fe084709384b485a (patch) | |
tree | beeb962bc5b689459859d31366c55bbf69016c1a /test/review | |
parent | 9a20086495e7734b636c5ee625d305a3fbaea476 (diff) | |
download | scala-ec3438c28987a38a3c03ebb5fe084709384b485a.tar.gz scala-ec3438c28987a38a3c03ebb5fe084709384b485a.tar.bz2 scala-ec3438c28987a38a3c03ebb5fe084709384b485a.zip |
Linked up $class visibility to symbol redefinition.
In what feels like divine intervention as I spent my entire day
yesterday unsuccessfully attempting to understand why running atop my
new classpath code, trunk would compile and then fail like this:
build.xml:1683: Could not create type partest due to java.lang.NoSuchMethodError:
scala.tools.ant.sabbus.CompilationPathProperty$class.$init$(Lscala/tools/ant/sabbus/CompilationPathProperty;)V
I discovered the link by trying to debug a seemingly completely
unrelated problem reported by pvlugter.
On the one hand you have PathResolver/ClassPath, which by default does
not place trait implementation classes on the compilation classpath, but
does do so under -optimise (as I understand it, this is so inlining can
be performed, so let us ignore the fact that methods in traits are never
inlined, as outlined in SI-4767.)
object DefaultJavaContext extends JavaContext {
override def isValidName(name: String) = !isTraitImplementation(name)
}
Then on the other hand you have this logic in AddInterfaces:
if (impl != NoSymbol && settings.optimise.value) {
log("unlinking impl class " + impl)
...
}
The test in AddInterfaces is hardcoded to only consider the value of
-optimise. Which means that in the completely default -optimise setup,
it corresponds to the answers given by "isValidName" in JavaContext,
but nothing keeps those elements in sync. The connection to my lost day
was that, thinking I was "simplifying" my development, I had commented
out the override in DefaultJavaContext so that all classes were on the
compilation path. This caused the state of settings.optimise (still
false) and whether impl classes were on the classpath (now true) to fall
into fatal disagreement.
Diffstat (limited to 'test/review')
0 files changed, 0 insertions, 0 deletions