diff options
Diffstat (limited to 'src')
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) < 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 |