summaryrefslogtreecommitdiff
path: root/src/scalap
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-02-25 21:20:59 +0000
committerPaul Phillips <paulp@improving.org>2010-02-25 21:20:59 +0000
commit52f85091e1f8dffb6018ab26ef0810065b45ad93 (patch)
tree8a62385f36de3919ac3f1df260310e8fab5bb1cd /src/scalap
parent6e768fe8c5e14b5e1b4540eb8b944e5bb0ae9651 (diff)
downloadscala-52f85091e1f8dffb6018ab26ef0810065b45ad93.tar.gz
scala-52f85091e1f8dffb6018ab26ef0810065b45ad93.tar.bz2
scala-52f85091e1f8dffb6018ab26ef0810065b45ad93.zip
More return type annotation to work around my o...
More return type annotation to work around my other frequent guest in the world of #3082-connected pickler bugs. No review.
Diffstat (limited to 'src/scalap')
-rw-r--r--src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala2
-rw-r--r--src/scalap/scala/tools/scalap/scalax/rules/Result.scala10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala b/src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala
index 1324ea695a..827c2dfff7 100644
--- a/src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala
+++ b/src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala
@@ -44,7 +44,7 @@ trait DefaultMemoisable extends Memoisable {
map.getOrElseUpdate(key, compute(key, a)).asInstanceOf[A]
}
- protected def compute[A](key : AnyRef, a : => A) = a match {
+ protected def compute[A](key : AnyRef, a : => A): Any = a match {
case success : Success[_, _] => onSuccess(key, success); success
case other =>
if(DefaultMemoisable.debug) println(key + " -> " + other)
diff --git a/src/scalap/scala/tools/scalap/scalax/rules/Result.scala b/src/scalap/scala/tools/scalap/scalax/rules/Result.scala
index 6befbb83c8..17ad4bd053 100644
--- a/src/scalap/scala/tools/scalap/scalax/rules/Result.scala
+++ b/src/scalap/scala/tools/scalap/scalax/rules/Result.scala
@@ -42,11 +42,11 @@ case class Success[+Out, +A](out : Out, value : A) extends Result[Out, A, Nothin
def toOption = Some(value)
- def map[B](f : A => B) = Success(out, f(value))
- def mapOut[Out2](f : Out => Out2) = Success(f(out), value)
- def map[Out2, B](f : (Out, A) => (Out2, B)) = f(out, value) match { case (out2, b) => Success(out2, b) }
- def flatMap[Out2, B](f : (Out, A) => Result[Out2, B, Nothing]) = f(out, value)
- def orElse[Out2 >: Out, B >: A](other : => Result[Out2, B, Nothing]) = this
+ def map[B](f : A => B) : Result[Out, B, Nothing] = Success(out, f(value))
+ def mapOut[Out2](f : Out => Out2) : Result[Out2, A, Nothing] = Success(f(out), value)
+ def map[Out2, B](f : (Out, A) => (Out2, B)) : Success[Out2, B] = f(out, value) match { case (out2, b) => Success(out2, b) }
+ def flatMap[Out2, B](f : (Out, A) => Result[Out2, B, Nothing]) : Result[Out2, B, Nothing]= f(out, value)
+ def orElse[Out2 >: Out, B >: A](other : => Result[Out2, B, Nothing]) : Result[Out2, B, Nothing] = this
}
sealed abstract class NoSuccess[+X] extends Result[Nothing, Nothing, X] {