We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 59b4a1a + 2c6e536 commit e9d49c8Copy full SHA for e9d49c8
src/main/scala/stdlib/HigherOrderFunctions.scala
@@ -87,7 +87,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
87
/** Function returning another function:
88
*/
89
def returningFunctionHigherOrderFunctions(res0: Boolean, res1: Int, res2: Int) {
90
- def addWithoutSyntaxSugar(x: Int) = {
+ def addWithoutSyntaxSugar(x: Int): Function1[Int, Int] = {
91
new Function1[Int, Int]() {
92
def apply(y: Int): Int = x + y
93
}
@@ -97,7 +97,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
97
98
addWithoutSyntaxSugar(2)(3) should be(res1)
99
100
- def fiveAdder = addWithoutSyntaxSugar(5)
+ def fiveAdder: Function1[Int, Int] = addWithoutSyntaxSugar(5)
101
fiveAdder(5) should be(res2)
102
103
0 commit comments