File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
87
87
/** Function returning another function:
88
88
*/
89
89
def returningFunctionHigherOrderFunctions (res0 : Boolean , res1 : Int , res2 : Int ) {
90
- def addWithoutSyntaxSugar (x : Int ) = {
90
+ def addWithoutSyntaxSugar (x : Int ): Function1 [ Int , Int ] = {
91
91
new Function1 [Int , Int ]() {
92
92
def apply (y : Int ): Int = x + y
93
93
}
@@ -97,7 +97,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
97
97
98
98
addWithoutSyntaxSugar(2 )(3 ) should be(res1)
99
99
100
- def fiveAdder = addWithoutSyntaxSugar(5 )
100
+ def fiveAdder : Function1 [ Int , Int ] = addWithoutSyntaxSugar(5 )
101
101
fiveAdder(5 ) should be(res2)
102
102
}
103
103
You can’t perform that action at this time.
0 commit comments