Skip to content

Commit e9d49c8

Browse files
Merge pull request #56 from scala-exercises/andyscott-annotate-return-types
Clarify return types for a few spots in stdlib
2 parents 59b4a1a + 2c6e536 commit e9d49c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/stdlib/HigherOrderFunctions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
8787
/** Function returning another function:
8888
*/
8989
def returningFunctionHigherOrderFunctions(res0: Boolean, res1: Int, res2: Int) {
90-
def addWithoutSyntaxSugar(x: Int) = {
90+
def addWithoutSyntaxSugar(x: Int): Function1[Int, Int] = {
9191
new Function1[Int, Int]() {
9292
def apply(y: Int): Int = x + y
9393
}
@@ -97,7 +97,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
9797

9898
addWithoutSyntaxSugar(2)(3) should be(res1)
9999

100-
def fiveAdder = addWithoutSyntaxSugar(5)
100+
def fiveAdder: Function1[Int, Int] = addWithoutSyntaxSugar(5)
101101
fiveAdder(5) should be(res2)
102102
}
103103

0 commit comments

Comments
 (0)