summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--src/compiler/scala/tools/nsc/GenericRunnerSettings.scala2
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala16
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala16
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala10
-rw-r--r--src/compiler/scala/tools/util/PathResolver.scala12
-rw-r--r--test/junit/scala/collection/immutable/StreamTest.scala4
-rwxr-xr-xtest/partest3
-rw-r--r--versions.properties8
9 files changed, 30 insertions, 43 deletions
diff --git a/README.md b/README.md
index 0cc7e98b0e..fc73de2273 100644
--- a/README.md
+++ b/README.md
@@ -178,7 +178,7 @@ We typically alias `build/quick/bin/scalac -d sandbox` to `qsc` and `build/quick
Note: on most machines this requires more heap than is allocate by default. You can adjust the parameters with ANT_OPTS. Example command line:
```
-ANT_OPTS = "-Xms512M -Xmx2048M -Xss1M -XX:MaxPermSize=128M" ant docs
+ANT_OPTS = "-Xms512M -Xmx2048M -Xss1M" ant docs
```
- `ant dist` builds a distribution in 'dists/latest'.
diff --git a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
index 1289d55c37..e99cce9186 100644
--- a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
+++ b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
@@ -9,7 +9,7 @@ import java.net.URL
import scala.tools.util.PathResolverFactory
class GenericRunnerSettings(error: String => Unit) extends Settings(error) {
- def classpathURLs: Seq[URL] = PathResolverFactory.create(this).resultAsURLs
+ lazy val classpathURLs: Seq[URL] = PathResolverFactory.create(this).resultAsURLs
val howtorun =
ChoiceSetting(
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
index 7b238e56eb..9b4451d492 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
@@ -351,15 +351,15 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
val isTopLevel = innerClassSym.rawowner.isPackageClass
// impl classes are considered top-level, see comment in BTypes
if (isTopLevel || considerAsTopLevelImplementationArtifact(innerClassSym)) None
- else if (innerClassSym.rawowner.isTerm)
- // SI-9392 An errant macro might leave a reference to a local class symbol that no longer exists in the tree,
- // this avoids an assertion error in that case. AFAICT, we don't actually need the `NestedInfo` for all BTypes,
- // only for ones that describe classes defined in the trees that reach the backend, so this is safe enough.
- //
- // TODO Can we avoid creating `NestedInfo` for each type that is referred to, and instead only create if for
- // symbols of ClassDefs?
+ else if (innerClassSym.rawowner.isTerm) {
+ // This case should never be reached: the lambdalift phase mutates the rawowner field of all
+ // classes to be the enclosing class. SI-9392 shows an errant macro that leaves a reference
+ // to a local class symbol that no longer exists, which is not updated by lambdalift.
+ devWarning(innerClassSym.pos,
+ s"""The class symbol $innerClassSym with the term symbol ${innerClassSym.rawowner} as `rawowner` reached the backend.
+ |Most likely this indicates a stale reference to a non-existing class introduced by a macro, see SI-9392.""".stripMargin)
None
- else {
+ } else {
// See comment in BTypes, when is a class marked static in the InnerClass table.
val isStaticNestedClass = isOriginallyStaticOwner(innerClassSym.originalOwner)
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
index 58f0813bd8..92b9b34006 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
@@ -70,10 +70,10 @@ class ClosureOptimizer[BT <: BTypes](val btypes: BT) {
}
}
- // Group the closure instantiations by method allows running the ProdConsAnalyzer only once per method.
- // Also sort the instantiations: If there are multiple closure instantiations in a method, closure
- // invocations need to be re-written in a consistent order for bytecode stability. The local variable
- // slots for storing captured values depends on the order of rewriting.
+ // Grouping the closure instantiations by method allows running the ProdConsAnalyzer only once per
+ // method. Also sort the instantiations: If there are multiple closure instantiations in a method,
+ // closure invocations need to be re-written in a consistent order for bytecode stability. The local
+ // variable slots for storing captured values depends on the order of rewriting.
val closureInstantiationsByMethod: Map[MethodNode, immutable.TreeSet[ClosureInstantiation]] = {
closureInstantiations.values.groupBy(_.ownerMethod).mapValues(immutable.TreeSet.empty ++ _)
}
@@ -81,13 +81,13 @@ class ClosureOptimizer[BT <: BTypes](val btypes: BT) {
// For each closure instantiation, a list of callsites of the closure that can be re-written
// If a callsite cannot be rewritten, for example because the lambda body method is not accessible,
// a warning is returned instead.
- val callsitesToRewrite: Map[ClosureInstantiation, List[Either[RewriteClosureApplyToClosureBodyFailed, (MethodInsnNode, Int)]]] = {
- closureInstantiationsByMethod flatMap {
+ val callsitesToRewrite: List[(ClosureInstantiation, List[Either[RewriteClosureApplyToClosureBodyFailed, (MethodInsnNode, Int)]])] = {
+ closureInstantiationsByMethod.iterator.flatMap({
case (methodNode, closureInits) =>
// A lazy val to ensure the analysis only runs if necessary (the value is passed by name to `closureCallsites`)
lazy val prodCons = new ProdConsAnalyzer(methodNode, closureInits.head.ownerClass.internalName)
- closureInits.map(init => (init, closureCallsites(init, prodCons)))
- }
+ closureInits.iterator.map(init => (init, closureCallsites(init, prodCons)))
+ }).toList // mapping to a list (not a map) to keep the sorting of closureInstantiationsByMethod
}
// Rewrite all closure callsites (or issue inliner warnings for those that cannot be rewritten)
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index dedf268b56..f15bd3c31c 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -22,13 +22,9 @@ trait ScalaSettings extends AbsScalaSettings
/** Set of settings */
protected[scala] lazy val allSettings = mutable.HashSet[Setting]()
- /** Against my better judgment, giving in to martin here and allowing
- * CLASSPATH to be used automatically. So for the user-specified part
- * of the classpath:
- *
- * - If -classpath or -cp is given, it is that
- * - Otherwise, if CLASSPATH is set, it is that
- * - If neither of those, then "." is used.
+ /** The user class path, specified by `-classpath` or `-cp`,
+ * defaults to the value of CLASSPATH env var if it is set, as in Java,
+ * or else to `"."` for the current user directory.
*/
protected def defaultClasspath = sys.env.getOrElse("CLASSPATH", ".")
diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala
index f122437b63..09c6c9d744 100644
--- a/src/compiler/scala/tools/util/PathResolver.scala
+++ b/src/compiler/scala/tools/util/PathResolver.scala
@@ -254,17 +254,7 @@ abstract class PathResolverBase[BaseClassPathType <: ClassFileLookup[AbstractFil
* TODO: we should refactor this as a separate -bootstrap option to have a clean implementation, no? */
def sourcePath = if (!settings.isScaladoc) cmdLineOrElse("sourcepath", Defaults.scalaSourcePath) else ""
- /** Against my better judgment, giving in to martin here and allowing
- * CLASSPATH to be used automatically. So for the user-specified part
- * of the classpath:
- *
- * - If -classpath or -cp is given, it is that
- * - Otherwise, if CLASSPATH is set, it is that
- * - If neither of those, then "." is used.
- */
- def userClassPath =
- if (!settings.classpath.isDefault) settings.classpath.value
- else sys.env.getOrElse("CLASSPATH", ".")
+ def userClassPath = settings.classpath.value // default is specified by settings and can be overridden there
import classPathFactory._
diff --git a/test/junit/scala/collection/immutable/StreamTest.scala b/test/junit/scala/collection/immutable/StreamTest.scala
index 437cbc8926..fad4e502eb 100644
--- a/test/junit/scala/collection/immutable/StreamTest.scala
+++ b/test/junit/scala/collection/immutable/StreamTest.scala
@@ -12,11 +12,13 @@ import scala.util.Try
class StreamTest {
@Test
- def t6727_and_t6440(): Unit = {
+ def t6727_and_t6440_and_8627(): Unit = {
assertTrue(Stream.continually(()).filter(_ => true).take(2) == Seq((), ()))
assertTrue(Stream.continually(()).filterNot(_ => false).take(2) == Seq((), ()))
assertTrue(Stream(1,2,3,4,5).filter(_ < 4) == Seq(1,2,3))
assertTrue(Stream(1,2,3,4,5).filterNot(_ > 4) == Seq(1,2,3,4))
+ assertTrue(Stream.from(1).filter(_ > 4).take(3) == Seq(5,6,7))
+ assertTrue(Stream.from(1).filterNot(_ <= 4).take(3) == Seq(5,6,7))
}
/** Test helper to verify that the given Stream operation allows
diff --git a/test/partest b/test/partest
index f396459c6d..7e19c92165 100755
--- a/test/partest
+++ b/test/partest
@@ -117,8 +117,7 @@ fi
# last arg wins, so if JAVA_OPTS already contains -Xmx or -Xms the
# supplied argument will be used.
-# At this writing it is reported test/partest --all requires 108m permgen.
-JAVA_OPTS="-Xmx1024M -Xms64M -XX:MaxPermSize=128M $JAVA_OPTS"
+JAVA_OPTS="-Xmx1024M -Xms64M $JAVA_OPTS"
# the ant task doesn't supply any options by default,
# so don't do that here either -- note that you may want to pass -optimise
diff --git a/versions.properties b/versions.properties
index ad3d659aee..be197af2ac 100644
--- a/versions.properties
+++ b/versions.properties
@@ -5,10 +5,10 @@
# also add them to the update.versions mechanism in build.xml,
# which is used by the release script scripts/jobs/integrate/bootstrap
-# The scala version used for boostrapping. This has no impact on the final classfiles:
+# The scala version used for bootstrapping. This has no impact on the final classfiles:
# there are two stages (locker and quick), so compiler and library are always built
# with themselves. Stability is ensured by building a third stage (strap).
-starr.version=2.12.0-M1
+starr.version=2.12.0-M2
# These are the versions of the modules that go with this release.
# These properties are used during PR validation and in dbuild builds.
@@ -18,8 +18,8 @@ starr.version=2.12.0-M1
# It has to be set in the following way:
# - After 2.x.0 is released, the binary version is 2.x.
# - During milestones and RCs, modules are cross-built against the full version.
-# So the value is the full version (e.g. 2.12.0-M1).
-scala.binary.version=2.12.0-M1
+# So the value is the full version (e.g. 2.12.0-M2).
+scala.binary.version=2.12.0-M2
# external modules shipped with distribution, as specified by scala-library-all's pom
scala-xml.version.number=1.0.4