summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-03-24 17:18:03 +0000
committerPaul Phillips <paulp@improving.org>2010-03-24 17:18:03 +0000
commita09cf5dbf7ed64e1ff52bebb53971d16304b58e5 (patch)
tree1fc48d708f2768e5135814bf5763c2ab87b04484 /src
parentd43ccc679de41aca085072d96a61e363e5e23e34 (diff)
downloadscala-a09cf5dbf7ed64e1ff52bebb53971d16304b58e5.tar.gz
scala-a09cf5dbf7ed64e1ff52bebb53971d16304b58e5.tar.bz2
scala-a09cf5dbf7ed64e1ff52bebb53971d16304b58e5.zip
Renamed partialMap to collect.
method on Iterator called collect which I had to remove, because if the method is overloaded it puts a bullet in the type inference, an intolerable result for a function which takes a partial function as its argument. I don't think there's much chance of confusion, but I put a migration warning on collect just in case. No review.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/Interpreter.scala2
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala14
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/PackageCompletion.scala2
-rw-r--r--src/compiler/scala/tools/nsc/io/AbstractFile.scala2
-rw-r--r--src/compiler/scala/tools/nsc/io/Directory.scala6
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala2
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Symbols.scala6
-rw-r--r--src/compiler/scala/tools/nsc/util/ClassPath.scala12
-rw-r--r--src/compiler/scala/tools/util/BashCompletion.scala2
-rw-r--r--src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala6
-rw-r--r--src/library/scala/Option.scala2
-rw-r--r--src/library/scala/collection/Iterator.scala15
-rw-r--r--src/library/scala/collection/TraversableLike.scala4
-rw-r--r--src/library/scala/collection/TraversableProxyLike.scala2
-rw-r--r--src/library/scala/collection/TraversableViewLike.scala2
-rw-r--r--src/library/scala/collection/immutable/List.scala4
-rw-r--r--src/library/scala/collection/interfaces/TraversableMethods.scala2
-rw-r--r--src/partest/scala/tools/partest/PartestTask.scala2
-rw-r--r--src/scalap/scala/tools/scalap/Decode.scala4
19 files changed, 44 insertions, 47 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala
index cd9bbc6127..9e1c034f86 100644
--- a/src/compiler/scala/tools/nsc/Interpreter.scala
+++ b/src/compiler/scala/tools/nsc/Interpreter.scala
@@ -1204,7 +1204,7 @@ object Interpreter {
(implicit bf: CanBuildFrom[CC[A], B, CC[B]]) =
{
val b = bf(coll)
- for (x <- coll partialMap pf)
+ for (x <- coll collect pf)
b ++= x
b.result
diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
index f7fe5678fe..41de091055 100644
--- a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
@@ -177,11 +177,11 @@ class ModelFactory(val global: Global, val settings: doc.Settings) extends Comme
// Only this class's constructors are part of its members, inherited constructors are not.
sym.info.nonPrivateMembers.filter(x => (!x.isConstructor || x.owner==sym))
val members = memberSyms flatMap (makeMember(_, this))
- val templates = members partialMap { case c: DocTemplateEntity => c }
- val methods = members partialMap { case d: Def => d }
- val values = members partialMap { case v: Val => v }
- val abstractTypes = members partialMap { case t: AbstractType => t }
- val aliasTypes = members partialMap { case t: AliasType => t }
+ val templates = members collect { case c: DocTemplateEntity => c }
+ val methods = members collect { case d: Def => d }
+ val values = members collect { case v: Val => v }
+ val abstractTypes = members collect { case t: AbstractType => t }
+ val aliasTypes = members collect { case t: AliasType => t }
override def isTemplate = true
def isDocTemplate = true
def companion = sym.companionSymbol match {
@@ -193,7 +193,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) extends Comme
abstract class PackageImpl(sym: Symbol, inTpl: => PackageImpl) extends DocTemplateImpl(sym, inTpl) with Package {
override def inTemplate = inTpl
override def toRoot: List[PackageImpl] = this :: inTpl.toRoot
- val packages = members partialMap { case p: Package => p }
+ val packages = members collect { case p: Package => p }
}
abstract class RootPackageImpl(sym: Symbol) extends PackageImpl(sym, null) with RootPackageEntity
@@ -304,7 +304,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) extends Comme
def valueParams =
List(sym.constrParamAccessors map (makeValueParam(_, this)))
val constructors =
- members partialMap { case d: Constructor => d }
+ members collect { case d: Constructor => d }
def primaryConstructor = (constructors find (_.isPrimary))
def isCaseClass = sym.isClass && sym.hasFlag(Flags.CASE)
}
diff --git a/src/compiler/scala/tools/nsc/interpreter/PackageCompletion.scala b/src/compiler/scala/tools/nsc/interpreter/PackageCompletion.scala
index b75c0ca765..26ae4106c6 100644
--- a/src/compiler/scala/tools/nsc/interpreter/PackageCompletion.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/PackageCompletion.scala
@@ -141,7 +141,7 @@ object PackageCompletion {
* will look only in the scalaHome directories, which is most of what we want.
*/
def isUnderScalaHome(d: Directory) = d.parents exists (_ == scalaHomeDir)
- val dirs = cp partialMap { case x: Directory => x } filter isUnderScalaHome
+ val dirs = cp collect { case x: Directory => x } filter isUnderScalaHome
// for e.g. foo.bar.baz.C, returns (foo -> bar), (foo.bar -> baz), (foo.bar.baz -> C)
// and scala.Range$BigInt needs to go scala -> Range -> BigInt
diff --git a/src/compiler/scala/tools/nsc/io/AbstractFile.scala b/src/compiler/scala/tools/nsc/io/AbstractFile.scala
index 04aa661bd6..079b33c2a2 100644
--- a/src/compiler/scala/tools/nsc/io/AbstractFile.scala
+++ b/src/compiler/scala/tools/nsc/io/AbstractFile.scala
@@ -56,7 +56,7 @@ object AbstractFile
* @return ...
*/
def getURL(url: URL): AbstractFile =
- Option(url) partialMap { case url: URL if Path.isJarOrZip(url.getPath) => ZipArchive fromURL url } orNull
+ Option(url) collect { case url: URL if Path.isJarOrZip(url.getPath) => ZipArchive fromURL url } orNull
}
/**
diff --git a/src/compiler/scala/tools/nsc/io/Directory.scala b/src/compiler/scala/tools/nsc/io/Directory.scala
index 822dfbdffe..b8ce6e5355 100644
--- a/src/compiler/scala/tools/nsc/io/Directory.scala
+++ b/src/compiler/scala/tools/nsc/io/Directory.scala
@@ -50,8 +50,8 @@ class Directory(jfile: JFile) extends Path(jfile) {
case xs => xs.iterator map Path.apply
}
- def dirs: Iterator[Directory] = list partialMap { case x: Directory => x }
- def files: Iterator[File] = list partialMap { case x: File => x }
+ def dirs: Iterator[Directory] = list collect { case x: Directory => x }
+ def files: Iterator[File] = list collect { case x: File => x }
def deepDirs: Iterator[Directory] = Path.onlyDirs(deepList())
def deepFiles: Iterator[File] = Path.onlyFiles(deepList())
@@ -68,7 +68,7 @@ class Directory(jfile: JFile) extends Path(jfile) {
* to the (optionally) given depth.
*/
def subdirs(depth: Int = 1): Iterator[Directory] =
- deepList(depth) partialMap { case x: Directory => x }
+ deepList(depth) collect { case x: Directory => x }
/** Deletes the directory recursively. Returns false on failure.
* Use with caution!
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index ab7b9adf72..d4a920008f 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -149,7 +149,7 @@ trait ParallelMatching extends ast.TreeDSL
if (!scrut.isSimple) None
else {
val (_lits, others) = ps span isSwitchableConst
- val lits = _lits partialMap { case x: LiteralPattern => x }
+ val lits = _lits collect { case x: LiteralPattern => x }
condOpt(others) {
case Nil => new PatternSwitch(scrut, lits, None)
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
index e92fd28026..b36272bd18 100644
--- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
@@ -455,18 +455,18 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
}
def isDeprecated = hasAnnotation(DeprecatedAttr)
- def deprecationMessage = getAnnotationArg(DeprecatedAttr, 0) partialMap { case Literal(const) => const.stringValue }
+ def deprecationMessage = getAnnotationArg(DeprecatedAttr, 0) collect { case Literal(const) => const.stringValue }
// !!! when annotation arguments are not literal strings, but any sort of
// assembly of strings, there is a fair chance they will turn up here not as
// Literal(const) but some arbitrary AST. However nothing in the compiler
// prevents someone from writing a @migration annotation with a calculated
// string. So this needs attention. For now the fact that migration is
// private[scala] ought to provide enough protection.
- def migrationMessage = getAnnotationArg(MigrationAnnotationClass, 2) partialMap {
+ def migrationMessage = getAnnotationArg(MigrationAnnotationClass, 2) collect {
case Literal(const) => const.stringValue
case x => x.toString // should not be necessary, but better than silently ignoring an issue
}
- def elisionLevel = getAnnotationArg(ElidableMethodClass, 0) partialMap { case Literal(Constant(x: Int)) => x }
+ def elisionLevel = getAnnotationArg(ElidableMethodClass, 0) collect { case Literal(Constant(x: Int)) => x }
/** Does this symbol denote a wrapper object of the interpreter or its class? */
final def isInterpreterWrapper =
diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala
index 0560062bf1..9ec9bf584f 100644
--- a/src/compiler/scala/tools/nsc/util/ClassPath.scala
+++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala
@@ -32,7 +32,7 @@ object ClassPath {
/** Get all jars in directory */
def lsJars(dir: Directory, filt: String => Boolean = _ => true) =
- dir.files partialMap { case f if filt(f.name) && (f hasExtension "jar") => f.path } toList
+ dir.files collect { case f if filt(f.name) && (f hasExtension "jar") => f.path } toList
def basedir(s: String) =
if (s contains File.separator) s.substring(0, s.lastIndexOf(File.separator))
@@ -283,11 +283,11 @@ class SourcePath[T](dir: AbstractFile, val context: ClassPathContext[T]) extends
def asURLs = dir.sfile.toList map (_.toURL)
val sourcepaths: List[AbstractFile] = List(dir)
- lazy val classes: List[ClassRep] = dir partialMap {
+ lazy val classes: List[ClassRep] = dir collect {
case f if !f.isDirectory && validSourceFile(f.name) => ClassRep(None, Some(f))
} toList
- lazy val packages: List[SourcePath[T]] = dir partialMap {
+ lazy val packages: List[SourcePath[T]] = dir collect {
case f if f.isDirectory && validPackage(f.name) => new SourcePath[T](f, context)
} toList
@@ -304,11 +304,11 @@ class DirectoryClassPath(val dir: AbstractFile, val context: ClassPathContext[Ab
def asURLs = dir.sfile.toList map (_.toURL)
val sourcepaths: List[AbstractFile] = Nil
- lazy val classes: List[ClassRep] = dir partialMap {
+ lazy val classes: List[ClassRep] = dir collect {
case f if !f.isDirectory && validClassFile(f.name) => ClassRep(Some(f), None)
} toList
- lazy val packages: List[DirectoryClassPath] = dir partialMap {
+ lazy val packages: List[DirectoryClassPath] = dir collect {
case f if f.isDirectory && validPackage(f.name) => new DirectoryClassPath(f, context)
} toList
@@ -393,7 +393,7 @@ extends ClassPath[T] {
})
}
- def asClasspathString: String = join(entries partialMap {
+ def asClasspathString: String = join(entries collect {
case x: DirectoryClassPath => x.dir.path
case x: MergedClassPath[_] => x.asClasspathString
}: _*)
diff --git a/src/compiler/scala/tools/util/BashCompletion.scala b/src/compiler/scala/tools/util/BashCompletion.scala
index ad7c1136ca..ed9f1b505a 100644
--- a/src/compiler/scala/tools/util/BashCompletion.scala
+++ b/src/compiler/scala/tools/util/BashCompletion.scala
@@ -85,7 +85,7 @@ _scala_commands
import settings._
val phaseNames = "all" :: (new Global(settings) phaseNames)
- val phaseSettings = settings.visibleSettings partialMap { case x: PhasesSetting => "\"" + x.name + "\"" }
+ val phaseSettings = settings.visibleSettings collect { case x: PhasesSetting => "\"" + x.name + "\"" }
def settingStrings(s: Setting, expanded: Boolean) = s match {
case x: ChoiceSetting => if (expanded) x.choices map (x.name + ":" + _) else List(x.name + ":")
diff --git a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
index 14135a24ae..6acc685dc2 100644
--- a/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
+++ b/src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala
@@ -422,11 +422,11 @@ abstract class CPSAnnotationChecker extends CPSUtils {
case Match(select, cases) =>
- // TODO: can there be cases that are not CaseDefs?? check partialMap vs map!
- transChildrenInOrder(tree, tpe, List(select), cases:::(cases partialMap { case CaseDef(_, _, body) => body }))
+ // TODO: can there be cases that are not CaseDefs?? check collect vs map!
+ transChildrenInOrder(tree, tpe, List(select), cases:::(cases collect { case CaseDef(_, _, body) => body }))
case Try(block, catches, finalizer) =>
- val tpe1 = transChildrenInOrder(tree, tpe, Nil, block::catches:::(catches partialMap { case CaseDef(_, _, body) => body }))
+ val tpe1 = transChildrenInOrder(tree, tpe, Nil, block::catches:::(catches collect { case CaseDef(_, _, body) => body }))
val annots = filterAttribs(tpe1, MarkerCPSTypes)
if (annots.nonEmpty) {
diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala
index 3bebcedd20..f2da220775 100644
--- a/src/library/scala/Option.scala
+++ b/src/library/scala/Option.scala
@@ -127,7 +127,7 @@ sealed abstract class Option[+A] extends Product {
*
* @param pf the partial function.
*/
- def partialMap[B](pf: PartialFunction[A, B]): Option[B] =
+ def collect[B](pf: PartialFunction[A, B]): Option[B] =
if (!isEmpty && pf.isDefinedAt(this.get)) Some(pf(this.get)) else None
/** If the option is nonempty return it,
diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala
index def2d0e5a2..8510592ceb 100644
--- a/src/library/scala/collection/Iterator.scala
+++ b/src/library/scala/collection/Iterator.scala
@@ -13,7 +13,7 @@ package scala.collection
import mutable.{Buffer, ArrayBuffer, ListBuffer, StringBuilder}
import immutable.{List, Stream}
-import annotation.{ tailrec }
+import annotation.{ tailrec, migration }
/** The `Iterator` object provides various functions for
* creating specialized iterators.
@@ -416,7 +416,11 @@ trait Iterator[+A] { self =>
* @return a new iterator which yields each value `x` produced by this iterator for
* which `pf` is defined the image `pf(x)`.
*/
- def partialMap[B](pf: PartialFunction[A, B]): Iterator[B] = {
+ @migration(2, 8,
+ "This collect implementation bears no relationship to the one before 2.8.\n"+
+ "The previous behavior can be reproduced with toSeq."
+ )
+ def collect[B](pf: PartialFunction[A, B]): Iterator[B] = {
val self = buffered
new Iterator[B] {
private def skip() = while (self.hasNext && !pf.isDefinedAt(self.head)) self.next()
@@ -1271,13 +1275,6 @@ trait Iterator[+A] { self =>
@deprecated("use `indexWhere` instead")
def findIndexOf(p: A => Boolean): Int = indexWhere(p)
- /** Collect elements into a seq.
- *
- * @return a sequence which enumerates all elements of this iterator.
- */
- @deprecated("use toSeq instead")
- def collect: Seq[A] = toSeq
-
/** Returns a counted iterator from this iterator.
*/
@deprecated("use zipWithIndex in Iterator")
diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala
index a09bba625f..b5b3e1c05e 100644
--- a/src/library/scala/collection/TraversableLike.scala
+++ b/src/library/scala/collection/TraversableLike.scala
@@ -292,13 +292,13 @@ self =>
* `pf` to each element on which it is defined and collecting the results.
* The order of the elements is preserved.
*
- * @usecase def partialMap[B](pf: PartialFunction[A, B]): $Coll[B]
+ * @usecase def collect[B](pf: PartialFunction[A, B]): $Coll[B]
*
* @return a new $coll resulting from applying the given partial function
* `pf` to each element on which it is defined and collecting the results.
* The order of the elements is preserved.
*/
- def partialMap[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+ def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
val b = bf(repr)
for (x <- this) if (pf.isDefinedAt(x)) b += pf(x)
b.result
diff --git a/src/library/scala/collection/TraversableProxyLike.scala b/src/library/scala/collection/TraversableProxyLike.scala
index 803de9c745..e435393b38 100644
--- a/src/library/scala/collection/TraversableProxyLike.scala
+++ b/src/library/scala/collection/TraversableProxyLike.scala
@@ -38,7 +38,7 @@ trait TraversableProxyLike[+A, +Repr <: TraversableLike[A, Repr] with Traversabl
override def flatMap[B, That](f: A => Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = self.flatMap(f)(bf)
override def filter(p: A => Boolean): Repr = self.filter(p)
override def filterNot(p: A => Boolean): Repr = self.filterNot(p)
- override def partialMap[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = self.partialMap(pf)(bf)
+ override def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = self.collect(pf)(bf)
override def partition(p: A => Boolean): (Repr, Repr) = self.partition(p)
override def groupBy[K](f: A => K): Map[K, Repr] = self.groupBy(f)
override def forall(p: A => Boolean): Boolean = self.forall(p)
diff --git a/src/library/scala/collection/TraversableViewLike.scala b/src/library/scala/collection/TraversableViewLike.scala
index 4b335d1878..233125c0f3 100644
--- a/src/library/scala/collection/TraversableViewLike.scala
+++ b/src/library/scala/collection/TraversableViewLike.scala
@@ -172,7 +172,7 @@ self =>
// else super.map[B, That](f)(bf)
}
- override def partialMap[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[This, B, That]): That =
+ override def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[This, B, That]): That =
filter(pf.isDefinedAt).map(pf)(bf)
override def flatMap[B, That](f: A => Traversable[B])(implicit bf: CanBuildFrom[This, B, That]): That = {
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala
index fcc8ad726e..e3e8c8963e 100644
--- a/src/library/scala/collection/immutable/List.scala
+++ b/src/library/scala/collection/immutable/List.scala
@@ -547,7 +547,7 @@ object List extends SeqFactory[List] {
* Returns the `Left` values in the given `Iterable`
* of `Either`s.
*/
- @deprecated("use `xs partialMap { case Left(x: A) => x }' instead of `List.lefts(xs)'")
+ @deprecated("use `xs collect { case Left(x: A) => x }' instead of `List.lefts(xs)'")
def lefts[A, B](es: Iterable[Either[A, B]]) =
es.foldRight[List[A]](Nil)((e, as) => e match {
case Left(a) => a :: as
@@ -557,7 +557,7 @@ object List extends SeqFactory[List] {
/**
* Returns the `Right` values in the given`Iterable` of `Either`s.
*/
- @deprecated("use `xs partialMap { case Right(x: B) => x }' instead of `List.rights(xs)'")
+ @deprecated("use `xs collect { case Right(x: B) => x }' instead of `List.rights(xs)'")
def rights[A, B](es: Iterable[Either[A, B]]) =
es.foldRight[List[B]](Nil)((e, bs) => e match {
case Left(_) => bs
diff --git a/src/library/scala/collection/interfaces/TraversableMethods.scala b/src/library/scala/collection/interfaces/TraversableMethods.scala
index 08ade7586d..c695e2c1ef 100644
--- a/src/library/scala/collection/interfaces/TraversableMethods.scala
+++ b/src/library/scala/collection/interfaces/TraversableMethods.scala
@@ -24,7 +24,7 @@ trait TraversableMethods[+A, +This <: TraversableLike[A, This] with Traversable[
// maps/iteration
def flatMap[B, That](f: A => Traversable[B])(implicit bf: CanBuildFrom[This, B, That]): That
def map[B, That](f: A => B)(implicit bf: CanBuildFrom[This, B, That]): That
- def partialMap[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[This, B, That]): That
+ def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[This, B, That]): That
// new collections
def ++[B >: A, That](that: Iterator[B])(implicit bf: CanBuildFrom[This, B, That]): That
diff --git a/src/partest/scala/tools/partest/PartestTask.scala b/src/partest/scala/tools/partest/PartestTask.scala
index afe685a443..96802370fc 100644
--- a/src/partest/scala/tools/partest/PartestTask.scala
+++ b/src/partest/scala/tools/partest/PartestTask.scala
@@ -236,7 +236,7 @@ class PartestTask extends Task with CompilationPathProperty {
val results: Iterable[(String, Int)] = antRunner.reflectiveRunTestsForFiles(files, name)
val (succs, fails) = resultsToStatistics(results)
- val failed: Iterable[String] = results partialMap {
+ val failed: Iterable[String] = results collect {
case (path, 1) => path + " [FAILED]"
case (path, 2) => path + " [TIMOUT]"
}
diff --git a/src/scalap/scala/tools/scalap/Decode.scala b/src/scalap/scala/tools/scalap/Decode.scala
index 4b319da13a..e9f9a390c5 100644
--- a/src/scalap/scala/tools/scalap/Decode.scala
+++ b/src/scalap/scala/tools/scalap/Decode.scala
@@ -58,7 +58,7 @@ object Decode {
xs.toList map (_.name dropRight 1)
}
- (ssig.symbols partialMap f).flatten toList
+ (ssig.symbols collect f).flatten toList
}
}
@@ -70,7 +70,7 @@ object Decode {
ssig <- ScalaSigParser.parse(clazz)
}
yield {
- val typeAliases = ssig.symbols partialMap { case x: AliasSymbol => x }
+ val typeAliases = ssig.symbols collect { case x: AliasSymbol => x }
Map(typeAliases map (x => (x.name, getAliasSymbol(x.infoType).path)): _*)
}
}