From 2c6e536ec8a618c91d61bdfee9c55b4425b8ab05 Mon Sep 17 00:00:00 2001 From: Andy Scott Date: Wed, 28 Sep 2016 15:59:14 -0700 Subject: [PATCH] Clarify return types for a few spots in stdlib --- src/main/scala/stdlib/HigherOrderFunctions.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/stdlib/HigherOrderFunctions.scala b/src/main/scala/stdlib/HigherOrderFunctions.scala index 894ebd6d..3f38956f 100644 --- a/src/main/scala/stdlib/HigherOrderFunctions.scala +++ b/src/main/scala/stdlib/HigherOrderFunctions.scala @@ -87,7 +87,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis /** Function returning another function: */ def returningFunctionHigherOrderFunctions(res0: Boolean, res1: Int, res2: Int) { - def addWithoutSyntaxSugar(x: Int) = { + def addWithoutSyntaxSugar(x: Int): Function1[Int, Int] = { new Function1[Int, Int]() { def apply(y: Int): Int = x + y } @@ -97,7 +97,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis addWithoutSyntaxSugar(2)(3) should be(res1) - def fiveAdder = addWithoutSyntaxSugar(5) + def fiveAdder: Function1[Int, Int] = addWithoutSyntaxSugar(5) fiveAdder(5) should be(res2) }