summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/ant/Scalac.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-23 07:30:21 -0800
committerPaul Phillips <paulp@improving.org>2012-01-23 08:06:02 -0800
commitec3438c28987a38a3c03ebb5fe084709384b485a (patch)
treebeeb962bc5b689459859d31366c55bbf69016c1a /src/compiler/scala/tools/ant/Scalac.scala
parent9a20086495e7734b636c5ee625d305a3fbaea476 (diff)
downloadscala-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 'src/compiler/scala/tools/ant/Scalac.scala')
-rw-r--r--src/compiler/scala/tools/ant/Scalac.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala
index 7aff4e3e8e..04ff0c440d 100644
--- a/src/compiler/scala/tools/ant/Scalac.scala
+++ b/src/compiler/scala/tools/ant/Scalac.scala
@@ -608,7 +608,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
if (!deprecation.isEmpty) settings.deprecation.value = deprecation.get
if (!nobootcp.isEmpty) settings.nobootcp.value = nobootcp.get
if (!nowarn.isEmpty) settings.nowarn.value = nowarn.get
- if (!optimise.isEmpty) settings.XO.value = optimise.get
+ if (!optimise.isEmpty) settings.optimise.value = optimise.get
if (!unchecked.isEmpty) settings.unchecked.value = unchecked.get
if (!usejavacp.isEmpty) settings.usejavacp.value = usejavacp.get