We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 13aa90a + 537b787 commit 2bde75aCopy full SHA for 2bde75a
src/main/scala/stdlib/Options.scala
@@ -98,8 +98,8 @@ object Options extends FlatSpec with Matchers with org.scalaexercises.definition
98
def foldOptions(res0: Int, res1: Int) {
99
val number: Option[Int] = Some(3)
100
val noNumber: Option[Int] = None
101
- val result1 = number.fold(0)(_ * 3)
102
- val result2 = noNumber.fold(0)(_ * 3)
+ val result1 = number.fold(1)(_ * 3)
+ val result2 = noNumber.fold(1)(_ * 3)
103
104
result1 should be(res0)
105
result2 should be(res1)
0 commit comments