Skip to content

Commit 709a66d

Browse files
authored
Merge pull request #1882 from kimhongji/patch-1
Update polymorphic-methods.md
2 parents 9ac8ff2 + 33fc1d0 commit 709a66d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_tour/polymorphic-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ println(listOfDuplicates[Int](3, 4)) // List(3, 3, 3, 3)
2727
println(listOfDuplicates("La", 8)) // List(La, La, La, La, La, La, La, La)
2828
```
2929

30-
The method `listOfDuplicates` takes a type parameter `A` and value parameters `x` and `length`. Value `x` is of type `A`. If `length < 1` we return an empty list. Otherwise we prepend `x` to the the list of duplicates returned by the recursive call. (Note that `::` means prepend an element on the left to a list on the right.)
30+
The method `listOfDuplicates` takes a type parameter `A` and value parameters `x` and `length`. Value `x` is of type `A`. If `length < 1` we return an empty list. Otherwise we prepend `x` to the list of duplicates returned by the recursive call. (Note that `::` means prepend an element on the left to a list on the right.)
3131

3232
In first example call, we explicitly provide the type parameter by writing `[Int]`. Therefore the first argument must be an `Int` and the return type will be `List[Int]`.
3333

0 commit comments

Comments
 (0)