diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2012-07-11 22:13:05 +0200 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2012-07-29 17:15:35 +0200 |
commit | 855f01b30b37ee8f07612d8e568eda5d408fd2df (patch) | |
tree | a89ffe26363609ef17e03864490fc246279fadfa /test/files/run/t6064.scala | |
parent | bad93927836f302be3b973335a63bb5e69b2237c (diff) | |
download | scala-855f01b30b37ee8f07612d8e568eda5d408fd2df.tar.gz scala-855f01b30b37ee8f07612d8e568eda5d408fd2df.tar.bz2 scala-855f01b30b37ee8f07612d8e568eda5d408fd2df.zip |
SI-6064 Add method contains to Option.
The Option API more or less mirrors the Collection API,
but it seems that somehow this method has been forgotten.
Review: @axel22
Diffstat (limited to 'test/files/run/t6064.scala')
-rw-r--r-- | test/files/run/t6064.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/run/t6064.scala b/test/files/run/t6064.scala new file mode 100644 index 0000000000..fc184dd92d --- /dev/null +++ b/test/files/run/t6064.scala @@ -0,0 +1,9 @@ +object Test extends App { + assert(Option(42) contains 42) + assert(Some(42) contains 42) + assert(Option(BigInt(42)) contains 42) + assert(Option(42) contains BigInt(42)) + assert(!(None contains 42)) + assert(Some(null) contains null) + assert(!(Option(null) contains null)) +}
\ No newline at end of file |