Skip to content

Commit a3ba57d

Browse files
Fix tut
1 parent 8135a18 commit a3ba57d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

_tour/polymorphic-methods.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ Methods in Scala can be parameterized by type as well as value. The syntax is si
2020
Here is an example:
2121

2222
```tut
23-
def listOfDuplicates[A](x: A, length: Int): List[A] =
23+
def listOfDuplicates[A](x: A, length: Int): List[A] = {
2424
if (length < 1)
2525
Nil
2626
else
2727
x :: listOfDuplicates(x, length - 1)
28+
}
2829
println(listOfDuplicates[Int](3, 4)) // List(3, 3, 3, 3)
2930
println(listOfDuplicates("La", 8)) // List(La, La, La, La, La, La, La, La)
3031
```

0 commit comments

Comments
 (0)