Created
May 26, 2011 14:38
-
-
Save seratch/993278 to your computer and use it in GitHub Desktop.
diff scala-2.9.0.final scala-2.9.0.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/scala-compiler-src.jar | |
src/scala-library-src.jar | |
diff -r scala-2.9.0.final/src/scala/tools/nsc/ast/TreeGen.scala scala-2.9.0.1/src/scala/tools/nsc/ast/TreeGen.scala | |
233,240c233,246 | |
< val sym = tp.typeSymbol | |
< val tree = | |
< if (sym == UnitClass) Literal(()) | |
< else if (sym == BooleanClass) Literal(false) | |
< else if (isValueClass(sym)) Literal(0) | |
< else if (NullClass.tpe <:< tp) Literal(null: Any) | |
< else abort("Cannot determine zero for " + tp) | |
< | |
--- | |
> val tree = tp.typeSymbol match { | |
> case UnitClass => Literal(()) | |
> case BooleanClass => Literal(false) | |
> case FloatClass => Literal(0.0f) | |
> case DoubleClass => Literal(0.0d) | |
> case ByteClass => Literal(0.toByte) | |
> case ShortClass => Literal(0.toShort) | |
> case IntClass => Literal(0) | |
> case LongClass => Literal(0L) | |
> case CharClass => Literal(0.toChar) | |
> case _ => | |
> if (NullClass.tpe <:< tp) Literal(null: Any) | |
> else abort("Cannot determine zero for " + tp) | |
> } | |
diff -r scala-2.9.0.final/src/scala/tools/nsc/transform/CleanUp.scala scala-2.9.0.1/src/scala/tools/nsc/transform/CleanUp.scala | |
37,41c37,40 | |
< def fix(tree: Tree): Tree = tree match { | |
< case Select(qual, name) => treeCopy.Select(tree, fix(qual), name) | |
< case This(_) if tree.symbol.isInterface && tree.symbol.name + "$class" == currentClass.name.toString => | |
< tree.setSymbol(currentClass).setType(currentClass.tpe) | |
< case _ => tree | |
--- | |
> def fix(tree: Tree): Unit = tree match { | |
> case Select(qual @ This(_), name) if qual.symbol != currentClass => | |
> qual.setSymbol(currentClass).setType(currentClass.tpe) | |
> case _ => | |
44c43,44 | |
< if (currentClass.isImplClass) fix(tree) else tree | |
--- | |
> if (currentClass.isImplClass && sym.owner == currentClass) fix(tree) | |
> tree | |
diff -r scala-2.9.0.final/src/scala/tools/nsc/typechecker/Typers.scala scala-2.9.0.1/src/scala/tools/nsc/typechecker/Typers.scala | |
946c946 | |
< // would typechek. Or one can simply leave out the type of the `val': | |
--- | |
> // would typecheck. Or one can simply leave out the type of the `val': | |
3779c3779,3782 | |
< stabilize(tree2, pre2, mode, pt) | |
--- | |
> stabilize(tree2, pre2, mode, pt) match { | |
> case accErr: Inferencer#AccessError => accErr.emit() | |
> case result => result | |
> } | |
diff -r scala-2.9.0.final/src/scala/collection/generic/GenericTraversableTemplate.scala scala-2.9.0.1/src/scala/collection/generic/GenericTraversableTemplate.scala | |
70c70 | |
< private def sequential: TraversableOnce[A] = this.asInstanceOf[TraversableOnce[A]].seq | |
--- | |
> private def sequential: TraversableOnce[A] = this.asInstanceOf[GenTraversableOnce[A]].seq | |
diff -r scala-2.9.0.final/src/scala/collection/immutable/MapLike.scala scala-2.9.0.1/src/scala/collection/immutable/MapLike.scala | |
119c119,128 | |
< override def keySet: immutable.Set[A] = immutable.Set.empty ++ (this map (_._1)) | |
--- | |
> override def keySet: immutable.Set[A] = new ImmutableDefaultKeySet | |
> | |
> protected class ImmutableDefaultKeySet extends super.DefaultKeySet with immutable.Set[A] { | |
> override def + (elem: A): immutable.Set[A] = | |
> if (this(elem)) this | |
> else immutable.Set[A]() ++ this + elem | |
> override def - (elem: A): immutable.Set[A] = | |
> if (this(elem)) immutable.Set[A]() ++ this - elem | |
> else this | |
> } | |
diff -r scala-2.9.0.final/src/scala/collection/immutable/Range.scala scala-2.9.0.1/src/scala/collection/immutable/Range.scala | |
333,334c333,334 | |
< @bridge override def foreach[@specialized(Unit) U](f: Int => U) = | |
< super.foreach(f) | |
--- | |
> // @bridge override def foreach[@specialized(Unit) U](f: Int => U) = | |
> // super.foreach(f) | |
diff -r scala-2.9.0.final/src/scala/collection/immutable/SortedMap.scala scala-2.9.0.1/src/scala/collection/immutable/SortedMap.scala | |
34c34 | |
< with SortedMapLike[A, B, SortedMap[A, B]] { | |
--- | |
> with SortedMapLike[A, B, SortedMap[A, B]] { self => | |
41c41,54 | |
< override def keySet: immutable.SortedSet[A] = SortedSet.empty ++ (this map (_._1)) | |
--- | |
> override def keySet: immutable.SortedSet[A] = new DefaultKeySortedSet | |
> | |
> protected class DefaultKeySortedSet extends super.DefaultKeySortedSet with immutable.SortedSet[A] { | |
> override def + (elem: A): SortedSet[A] = | |
> if (this(elem)) this | |
> else SortedSet[A]() ++ this + elem | |
> override def - (elem: A): SortedSet[A] = | |
> if (this(elem)) SortedSet[A]() ++ this - elem | |
> else this | |
> override def rangeImpl(from : Option[A], until : Option[A]) : SortedSet[A] = { | |
> val map = self.rangeImpl(from, until) | |
> new map.DefaultKeySortedSet | |
> } | |
> } | |
diff -r scala-2.9.0.final/src/scala/collection/TraversableOnce.scala scala-2.9.0.1/src/scala/collection/TraversableOnce.scala | |
349c349,354 | |
< def flatten: Iterator[A] = travs.foldLeft(Iterator.empty: Iterator[A])(_ ++ _) | |
--- | |
> def flatten: Iterator[A] = new Iterator[A] { | |
> val its = travs.toIterator | |
> private var it: Iterator[A] = Iterator.empty | |
> def hasNext: Boolean = it.hasNext || its.hasNext && { it = its.next.toIterator; hasNext } | |
> def next(): A = if (hasNext) it.next() else Iterator.empty.next() | |
> } | |
diff -r scala-2.9.0.final/src/scala/collection/TraversableViewLike.scala scala-2.9.0.1/src/scala/collection/TraversableViewLike.scala | |
18a19,20 | |
> // It is necessary to use thisSeq rather than toSeq to avoid cycles in the | |
> // eager evaluation of vals in transformed view subclasses, see #4558. | |
160c162 | |
< newForced(self.toSeq.scanLeft(z)(op)).asInstanceOf[That] | |
--- | |
> newForced(thisSeq.scanLeft(z)(op)).asInstanceOf[That] | |
167c169 | |
< newForced(self.toSeq.scanRight(z)(op)).asInstanceOf[That] | |
--- | |
> newForced(thisSeq.scanRight(z)(op)).asInstanceOf[That] | |
170c172 | |
< self.toSeq.groupBy(f).mapValues(xs => newForced(xs).asInstanceOf[This]) | |
--- | |
> thisSeq.groupBy(f).mapValues(xs => newForced(thisSeq)) | |
diff -r scala-2.9.0.final/src/scala/runtime/RichInt.scala scala-2.9.0.1/src/scala/runtime/RichInt.scala | |
24,25c24,25 | |
< @bridge | |
< def until(end: Int): Range with Range.ByOne = new Range(self, end, 1) with Range.ByOne | |
--- | |
> // @bridge | |
> // def until(end: Int): Range with Range.ByOne = new Range(self, end, 1) with Range.ByOne | |
31,32c31,32 | |
< @bridge | |
< def to(end: Int): Range with Range.ByOne = new Range.Inclusive(self, end, 1) with Range.ByOne | |
--- | |
> // @bridge | |
> // def to(end: Int): Range with Range.ByOne = new Range.Inclusive(self, end, 1) with Range.ByOne | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment