From 06162f8696a9c09c598b61c18bfc898dcd25b726 Mon Sep 17 00:00:00 2001 From: Ikenna Darlington Ogbajie Date: Fri, 17 Jun 2016 12:16:11 +0100 Subject: [PATCH 1/2] Options type error (Issue #13) Problem Test in the options exercise throws an error because the test expects a Float instead of a Double from the user Solution Change type of argument to doube --- src/main/scala/stdlib/Options.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/stdlib/Options.scala b/src/main/scala/stdlib/Options.scala index acb3cd3d..6f64c485 100644 --- a/src/main/scala/stdlib/Options.scala +++ b/src/main/scala/stdlib/Options.scala @@ -56,7 +56,7 @@ object Options extends FlatSpec with Matchers with exercise.Section { /** Option can also be used with pattern matching: */ - def matchOptions(res0: Float, res1: Float) { + def matchOptions(res0: Double, res1: Double) { val someValue: Option[Double] = Some(20.0) val value = someValue match { case Some(v) ⇒ v From 8da64420d555d1871be5902eb5826a42377e5ba1 Mon Sep 17 00:00:00 2001 From: Ikenna Darlington Ogbajie Date: Fri, 17 Jun 2016 13:48:39 +0100 Subject: [PATCH 2/2] Update OptionsSpec.scala --- src/test/scala/exercises/stdlib/OptionsSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/scala/exercises/stdlib/OptionsSpec.scala b/src/test/scala/exercises/stdlib/OptionsSpec.scala index d8a038af..af9bbb54 100644 --- a/src/test/scala/exercises/stdlib/OptionsSpec.scala +++ b/src/test/scala/exercises/stdlib/OptionsSpec.scala @@ -42,7 +42,7 @@ class OptionsSpec extends Spec with Checkers { check( Test.testSuccess( Options.matchOptions _, - 20F :: 0F :: HNil + 20D :: 0D :: HNil ) ) }