diff options
author | Paul Phillips <paulp@improving.org> | 2011-02-20 06:51:57 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-02-20 06:51:57 +0000 |
commit | fd1ca1e63c876046936f681be26730a301da8ff2 (patch) | |
tree | 6db9fac72b958af0df8c51eeae8478c0fe5b6a98 /src/library/scala/PartialFunction.scala | |
parent | 6a570deed1790889f7036a00c045c15217313587 (diff) | |
download | scala-fd1ca1e63c876046936f681be26730a301da8ff2.tar.gz scala-fd1ca1e63c876046936f681be26730a301da8ff2.tar.bz2 scala-fd1ca1e63c876046936f681be26730a301da8ff2.zip |
Moved unlift to the Function companion object, ...
Moved unlift to the Function companion object, which might have been
better in the first place. Had to make a minor change to genprod, and
then I couldn't escape that unscathed. Finished the not very complete
undertaking I found there to update the scaladoc. Lots of little changes
to the generated text and code.
I changed genprod to only put a unique stamp on Function0 so we can stop
having a 100 file diff everytime an i is dotted somewhere.
Closes #3825, no review.
Diffstat (limited to 'src/library/scala/PartialFunction.scala')
-rw-r--r-- | src/library/scala/PartialFunction.scala | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/library/scala/PartialFunction.scala b/src/library/scala/PartialFunction.scala index aae01eea94..c4af0f01e4 100644 --- a/src/library/scala/PartialFunction.scala +++ b/src/library/scala/PartialFunction.scala @@ -59,14 +59,12 @@ trait PartialFunction[-A, +B] extends (A => B) { } /** Turns this partial function into an plain function returning an `Option` result. - * @see Function1#unlift + * @see Function.unlift * @return a function that takes an argument `x` to `Some(this(x))` if `this` * is defined for `x`, and to `None` otherwise. */ def lift: A => Option[B] = new (A => Option[B]) { def apply(x: A): Option[B] = if (isDefinedAt(x)) Some(PartialFunction.this.apply(x)) else None - override def unlift[R1](implicit ev: Option[B] <:< Option[R1]): PartialFunction[A, R1] = - PartialFunction.this.asInstanceOf[PartialFunction[A, R1]] } } |