summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-10-21 17:06:26 +0000
committerMartin Odersky <odersky@gmail.com>2009-10-21 17:06:26 +0000
commit07a9de6b12c25473060268664911de3d116ab043 (patch)
tree4883b5548082c168cec19157d62a94c6ddfca841 /src
parent6bb3d2ceca8706180bb715f3c390cbcb891f5536 (diff)
downloadscala-07a9de6b12c25473060268664911de3d116ab043.tar.gz
scala-07a9de6b12c25473060268664911de3d116ab043.tar.bz2
scala-07a9de6b12c25473060268664911de3d116ab043.zip
Fixed #2429.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala2
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala8
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
-rw-r--r--src/library/scala/collection/SeqLike.scala8
4 files changed, 14 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 1765536d8d..9bd9c3ccfb 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -531,7 +531,7 @@ trait Types {
// val startTime = if (util.Statistics.enabled) System.nanoTime() else 0l
val result =
((this eq that) ||
- (if (explainSwitch) explain("<", isSubType, this, that)
+ (if (explainSwitch) explain("<:", isSubType, this, that)
else isSubType(this, that, AnyDepth)))
// if (util.Statistics.enabled) {
// subtypeNanos += System.nanoTime() - startTime
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 1eef2bf49d..2612e62f3e 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -1025,7 +1025,13 @@ abstract class ClassfileParser {
if (entry.outerName.endsWith("$")) entry.outerName.subName(0, entry.outerName.length - 1)
else entry.outerName
val sym = classSymbol(outerName)
- val s = atPhase(currentRun.typerPhase)(getMember(sym, innerName.toTypeName))
+ val s =
+ // if loading during initialization of `definitions' typerPhase is not yet set.
+ // in that case we simply load the mmeber at the current phase
+ if (currentRun.typerPhase != null)
+ atPhase(currentRun.typerPhase)(getMember(sym, innerName.toTypeName))
+ else
+ getMember(sym, innerName.toTypeName)
assert(s ne NoSymbol, sym + "." + innerName + " linkedModule: " + sym.linkedModuleOfClass + sym.linkedModuleOfClass.info.members)
s
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index d8fdaa9298..f6ceb7024a 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -801,7 +801,7 @@ trait Typers { self: Analyzer =>
case result: Tree => result
case ex: TypeError =>
if (settings.debug.value) log("fallback on implicits: "+tree)
- val tree1 = typed(original, mode, WildcardType)
+ val tree1 = typed(resetAttrs(original), mode, WildcardType)
tree1.tpe = addAnnotations(tree1, tree1.tpe)
if (tree1.isEmpty) tree1 else adapt(tree1, mode, pt, EmptyTree)
}
diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala
index 41cd6df77d..1a3151fd59 100644
--- a/src/library/scala/collection/SeqLike.scala
+++ b/src/library/scala/collection/SeqLike.scala
@@ -6,7 +6,7 @@
** |/ **
\* */
-// $Id: SeqLike.scala 18895 2009-10-02 17:57:16Z odersky $
+// $Id$
package scala.collection
@@ -545,7 +545,9 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
* .sortWith((e1, e2) => (e1 compareTo e2) &lt; 0) =
* List("Bob", "John", "Steve", "Tom")</pre>
*/
- def sortWith(lt: (A, A) => Boolean): Repr = {
+ def sortWith(lt: (A, A) => Boolean): Repr = sortWith(Ordering fromLessThan lt)
+
+ def sortWith[B >: A](ord: Ordering[B]): Repr = {
val arr = new GenericArray[A](this.length)
var i = 0
for (x <- this) {
@@ -553,7 +555,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
i += 1
}
java.util.Arrays.sort(
- arr.array, (Ordering fromLessThan lt).asInstanceOf[Ordering[Object]])
+ arr.array, ord.asInstanceOf[Ordering[Object]])
val b = newBuilder
for (x <- arr) b += x
b.result