diff options
author | Paul Phillips <paulp@improving.org> | 2011-07-24 22:07:16 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-07-24 22:07:16 +0000 |
commit | b78ca766a5b83ba9793e73fcb7e479b05fc7a50e (patch) | |
tree | 68ef4c99fc54767609ddc4502f2e9c619f7d44ed /src | |
parent | d521895e622acde2ceb11221c256de7413e90e5a (diff) | |
download | scala-b78ca766a5b83ba9793e73fcb7e479b05fc7a50e.tar.gz scala-b78ca766a5b83ba9793e73fcb7e479b05fc7a50e.tar.bz2 scala-b78ca766a5b83ba9793e73fcb7e479b05fc7a50e.zip |
Selective reversions, mostly over improbable bi...
Selective reversions, mostly over improbable binary compatibility
issues.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/interpreter/IMain.scala | 25 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Symbols.scala | 10 | ||||
-rwxr-xr-x | src/library/scala/reflect/generic/Flags.scala | 12 | ||||
-rwxr-xr-x | src/library/scala/reflect/generic/UnPickler.scala | 21 |
4 files changed, 51 insertions, 17 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/IMain.scala b/src/compiler/scala/tools/nsc/interpreter/IMain.scala index 68911d65f0..e78af9fb67 100644 --- a/src/compiler/scala/tools/nsc/interpreter/IMain.scala +++ b/src/compiler/scala/tools/nsc/interpreter/IMain.scala @@ -154,14 +154,15 @@ class IMain(val settings: Settings, protected val out: JPrintWriter) extends Imp @deprecated("Use `global` for access to the compiler instance.", "2.9.0") lazy val compiler: global.type = global - import global.{ treeWrapper => _, _ } + // import global.{ treeWrapper => _, _ } + import global._ import definitions.{ ScalaPackage, JavaLangPackage, PredefModule, RootClass } - - private implicit def privateTreeOps(t: Tree): List[Tree] = { - (new Traversable[Tree] { - def foreach[U](f: Tree => U): Unit = t foreach { x => f(x) ; () } - }).toList - } + // + // private implicit def privateTreeOps(t: Tree): List[Tree] = { + // (new Traversable[Tree] { + // def foreach[U](f: Tree => U): Unit = t foreach { x => f(x) ; () } + // }).toList + // } // TODO: If we try to make naming a lazy val, we run into big time // scalac unhappiness with what look like cycles. It has not been easy to @@ -455,11 +456,11 @@ class IMain(val settings: Settings, protected val out: JPrintWriter) extends Imp case Some(Nil) => return Left(IR.Error) // parse error or empty input case Some(trees) => trees } - repltrace( - trees map { t => - t map { t0 => t0.getClass + " at " + safePos(t0, -1) + "\n" } - } mkString - ) + // repltrace( + // trees map { t => + // t map { t0 => t0.getClass + " at " + safePos(t0, -1) + "\n" } + // } mkString + // ) // If the last tree is a bare expression, pinpoint where it begins using the // AST node position and snap the line off there. Rewrite the code embodied // by the last tree as a ValDef instead, so we can access the value. diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index 106c5f0c73..3806d156b4 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -429,11 +429,11 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable => def implicitNotFoundMsg = getAnnotation(ImplicitNotFoundClass) flatMap { _.stringArg(0) } /** Does this symbol denote a wrapper object of the interpreter or its class? */ - final def isInterpreterWrapper = - (isModule || isModuleClass) && - owner.isEmptyPackageClass && - (name startsWith nme.INTERPRETER_LINE_PREFIX) && - (name endsWith nme.INTERPRETER_WRAPPER_SUFFIX) + final def isInterpreterWrapper = ( + (isModule || isModuleClass) + && owner.isPackageClass + && (name containsName nme.INTERPRETER_IMPORT_WRAPPER) + ) /** Is this symbol an accessor method for outer? */ final def isOuterAccessor = { diff --git a/src/library/scala/reflect/generic/Flags.scala b/src/library/scala/reflect/generic/Flags.scala index b56faf8934..81e6fbddec 100755 --- a/src/library/scala/reflect/generic/Flags.scala +++ b/src/library/scala/reflect/generic/Flags.scala @@ -119,6 +119,18 @@ object ModifierFlags extends ModifierFlags private val rawFlags: Array[Int] = rawPickledCorrespondence map (_._1) private val pickledFlags: Array[Int] = rawPickledCorrespondence map (_._2) + // unused in 2.9.1: left to satisfy mima complaint about missing f$1 + private def mkCorrespondenceArray(correspondence: List[(Int, Int)]) = { + def f(flags: Int): Int = { + correspondence.foldLeft(0) { + case (result, (oldFlag, newFlag)) => + if ((flags & oldFlag) != 0) result | newFlag + else result + } + } + 0 to PKL_MASK map f toArray + } + private def r2p(flags: Int): Int = { var result = 0 var i = 0 diff --git a/src/library/scala/reflect/generic/UnPickler.scala b/src/library/scala/reflect/generic/UnPickler.scala index 1a8e0ae0f5..b7f324d6a3 100755 --- a/src/library/scala/reflect/generic/UnPickler.scala +++ b/src/library/scala/reflect/generic/UnPickler.scala @@ -66,6 +66,27 @@ abstract class UnPickler { //println("unpickled " + classRoot + ":" + classRoot.rawInfo + ", " + moduleRoot + ":" + moduleRoot.rawInfo);//debug + // Unused: left in 2.9.1 to satisfy mima. + private def run$unused() { + // read children last, fix for #3951 + val queue = new collection.mutable.ListBuffer[() => Unit]() + def delay(i: Int, action: => Unit) { + queue += (() => at(i, {() => action; null})) + } + + for (i <- 0 until index.length) { + if (isSymbolEntry(i)) + at(i, readSymbol) + else if (isSymbolAnnotationEntry(i)) + delay(i, readSymbolAnnotation()) + else if (isChildrenEntry(i)) + delay(i, readChildren()) + } + + for (action <- queue) + action() + } + // Laboriously unrolled for performance. def run() { var i = 0 |