diff options
author | Paul Phillips <paulp@improving.org> | 2010-02-16 23:48:32 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-02-16 23:48:32 +0000 |
commit | ab33bb1b34b86a71fa792f4a1e9a388c73192f02 (patch) | |
tree | 69f12ef88dab61d9429bf92d7de73d85d9eb4ccb | |
parent | 2e6f4e7246a6f688cd605fd216612a6eae13e488 (diff) | |
download | scala-ab33bb1b34b86a71fa792f4a1e9a388c73192f02.tar.gz scala-ab33bb1b34b86a71fa792f4a1e9a388c73192f02.tar.bz2 scala-ab33bb1b34b86a71fa792f4a1e9a388c73192f02.zip |
Took a less ambitious approach to restoring sta...
Took a less ambitious approach to restoring stability. Leave isLess as
it was and have the pickler sort without using isLess. Interestingly
this approach still leaves a class failing the stability test
(scala/actors/remote/Apply0.class) so a little more will be needed.
Review by odersky.
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Symbols.scala | 11 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index 00f5cc0add..d878839fea 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -982,15 +982,12 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable => def baseTypeSeqLength(sym: Symbol) = if (sym.isAbstractType) 1 + sym.info.bounds.hi.baseTypeSeq.length else sym.info.baseTypeSeq.length - - def lastCmp = this.sortName < that.sortName - if (this.isType) (that.isType && { val diff = baseTypeSeqLength(this) - baseTypeSeqLength(that) - diff > 0 || diff == 0 && lastCmp }) + diff > 0 || diff == 0 && this.id < that.id }) else - that.isType || lastCmp + that.isType || this.id < that.id } /** A partial ordering between symbols. @@ -1438,12 +1435,12 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable => /** The simple name of this Symbol */ final def simpleName: Name = name - /** The String used to order otherwise identical symbols in isLess. + /** The String used to order otherwise identical sealed symbols. * This uses data which is stable across runs and variable classpaths * (the initial Name) before falling back on id, which varies depending * on exactly when a symbol is loaded. */ - final private def sortName: String = initName.toString + "#" + id + final def sealedSortName: String = initName.toString + "#" + id /** String representation of symbol's definition key word */ final def keyString: String = diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index 5233868a3f..a4be75c879 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -145,7 +145,7 @@ abstract class Pickler extends SubComponent { localChildDummy.setInfo(ClassInfoType(List(sym.tpe), EmptyScope, localChildDummy)) localChildDummy :: globals } - putChildren(sym, children sortWith (_ isLess _)) + putChildren(sym, children sortBy (_.sealedSortName)) } for (annot <- staticAnnotations(sym.annotations.reverse)) putAnnotation(sym, annot) |