Skip to content

Commit b78ca76

Browse files
committed
Selective reversions, mostly over improbable bi...
Selective reversions, mostly over improbable binary compatibility issues.
1 parent d521895 commit b78ca76

File tree

4 files changed

+51
-17
lines changed

4 files changed

+51
-17
lines changed

src/compiler/scala/tools/nsc/interpreter/IMain.scala

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,15 @@ class IMain(val settings: Settings, protected val out: JPrintWriter) extends Imp
154154
@deprecated("Use `global` for access to the compiler instance.", "2.9.0")
155155
lazy val compiler: global.type = global
156156

157-
import global.{ treeWrapper => _, _ }
157+
// import global.{ treeWrapper => _, _ }
158+
import global._
158159
import definitions.{ ScalaPackage, JavaLangPackage, PredefModule, RootClass }
159-
160-
private implicit def privateTreeOps(t: Tree): List[Tree] = {
161-
(new Traversable[Tree] {
162-
def foreach[U](f: Tree => U): Unit = t foreach { x => f(x) ; () }
163-
}).toList
164-
}
160+
//
161+
// private implicit def privateTreeOps(t: Tree): List[Tree] = {
162+
// (new Traversable[Tree] {
163+
// def foreach[U](f: Tree => U): Unit = t foreach { x => f(x) ; () }
164+
// }).toList
165+
// }
165166

166167
// TODO: If we try to make naming a lazy val, we run into big time
167168
// 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
455456
case Some(Nil) => return Left(IR.Error) // parse error or empty input
456457
case Some(trees) => trees
457458
}
458-
repltrace(
459-
trees map { t =>
460-
t map { t0 => t0.getClass + " at " + safePos(t0, -1) + "\n" }
461-
} mkString
462-
)
459+
// repltrace(
460+
// trees map { t =>
461+
// t map { t0 => t0.getClass + " at " + safePos(t0, -1) + "\n" }
462+
// } mkString
463+
// )
463464
// If the last tree is a bare expression, pinpoint where it begins using the
464465
// AST node position and snap the line off there. Rewrite the code embodied
465466
// by the last tree as a ValDef instead, so we can access the value.

src/compiler/scala/tools/nsc/symtab/Symbols.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,11 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
429429
def implicitNotFoundMsg = getAnnotation(ImplicitNotFoundClass) flatMap { _.stringArg(0) }
430430

431431
/** Does this symbol denote a wrapper object of the interpreter or its class? */
432-
final def isInterpreterWrapper =
433-
(isModule || isModuleClass) &&
434-
owner.isEmptyPackageClass &&
435-
(name startsWith nme.INTERPRETER_LINE_PREFIX) &&
436-
(name endsWith nme.INTERPRETER_WRAPPER_SUFFIX)
432+
final def isInterpreterWrapper = (
433+
(isModule || isModuleClass)
434+
&& owner.isPackageClass
435+
&& (name containsName nme.INTERPRETER_IMPORT_WRAPPER)
436+
)
437437

438438
/** Is this symbol an accessor method for outer? */
439439
final def isOuterAccessor = {

src/library/scala/reflect/generic/Flags.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ object ModifierFlags extends ModifierFlags
119119
private val rawFlags: Array[Int] = rawPickledCorrespondence map (_._1)
120120
private val pickledFlags: Array[Int] = rawPickledCorrespondence map (_._2)
121121

122+
// unused in 2.9.1: left to satisfy mima complaint about missing f$1
123+
private def mkCorrespondenceArray(correspondence: List[(Int, Int)]) = {
124+
def f(flags: Int): Int = {
125+
correspondence.foldLeft(0) {
126+
case (result, (oldFlag, newFlag)) =>
127+
if ((flags & oldFlag) != 0) result | newFlag
128+
else result
129+
}
130+
}
131+
0 to PKL_MASK map f toArray
132+
}
133+
122134
private def r2p(flags: Int): Int = {
123135
var result = 0
124136
var i = 0

src/library/scala/reflect/generic/UnPickler.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ abstract class UnPickler {
6666

6767
//println("unpickled " + classRoot + ":" + classRoot.rawInfo + ", " + moduleRoot + ":" + moduleRoot.rawInfo);//debug
6868

69+
// Unused: left in 2.9.1 to satisfy mima.
70+
private def run$unused() {
71+
// read children last, fix for #3951
72+
val queue = new collection.mutable.ListBuffer[() => Unit]()
73+
def delay(i: Int, action: => Unit) {
74+
queue += (() => at(i, {() => action; null}))
75+
}
76+
77+
for (i <- 0 until index.length) {
78+
if (isSymbolEntry(i))
79+
at(i, readSymbol)
80+
else if (isSymbolAnnotationEntry(i))
81+
delay(i, readSymbolAnnotation())
82+
else if (isChildrenEntry(i))
83+
delay(i, readChildren())
84+
}
85+
86+
for (action <- queue)
87+
action()
88+
}
89+
6990
// Laboriously unrolled for performance.
7091
def run() {
7192
var i = 0

0 commit comments

Comments
 (0)