diff options
author | Max Bileschi <mbileschi@twitter.com> | 2014-06-27 11:44:55 -0400 |
---|---|---|
committer | Max Bileschi <mbileschi@twitter.com> | 2014-06-27 11:44:55 -0400 |
commit | 71bc2e5f4c49463a754a6f23e3abd2d27467fca4 (patch) | |
tree | e5c60458304f31b913c1e1f4de5820aaf70a422d /src | |
parent | 455bcd65c055119f928b3367839f0093cf0e251a (diff) | |
download | scala-71bc2e5f4c49463a754a6f23e3abd2d27467fca4.tar.gz scala-71bc2e5f4c49463a754a6f23e3abd2d27467fca4.tar.bz2 scala-71bc2e5f4c49463a754a6f23e3abd2d27467fca4.zip |
Revised comment to appeal to lchoran's and som-snytts comments
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/PartialFunction.scala | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/library/scala/PartialFunction.scala b/src/library/scala/PartialFunction.scala index 05888921d9..045ea319d9 100644 --- a/src/library/scala/PartialFunction.scala +++ b/src/library/scala/PartialFunction.scala @@ -21,11 +21,10 @@ package scala * val f: PartialFunction[Int, Any] = { case _ => 1/0 } * }}} * - * It is the responsibility of the caller of `apply` to check for membership - * in the domain by calling `isDefinedAt`, to ensure sanity of return values. - * A notable exception to this rule is `PartialFunction`s created with curly - * braces and case statements; In this case, a [[scala.MatchError]] is - * thrown if `isDefinedAt` (i.e. pattern matching) fails. + * It is the responsibility of the caller to call `isDefinedAt` before + * before calling `apply`, because if `isDefinedAt` is false, an exception + * may or may not be thrown. In the case that an exception is not thrown, + * an insane value may be returned. * * The main distinction between `PartialFunction` and [[scala.Function1]] is * that the user of a `PartialFunction` may choose to do something different |