Skip to content

Commit a95c97d

Browse files
Update 04-basic-declarations-and-definitions.md
Corrected the claimed outcome of the example in the section on repeated parameters. The example method sum sums up the _squares_ of the arguments.
1 parent b7ce9e4 commit a95c97d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/04-basic-declarations-and-definitions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ def sum(args: Int*) = {
726726
```
727727

728728
The following applications of this method yield `0`, `1`,
729-
`6`, in that order.
729+
`14`, in that order.
730730

731731
```scala
732732
sum()
@@ -747,7 +747,7 @@ sum(xs) // ***** error: expected: Int, found: List[Int]
747747
```
748748

749749
By contrast, the following application is well formed and yields again
750-
the result `6`:
750+
the result `14`:
751751

752752
```scala
753753
sum(xs: _*)

0 commit comments

Comments
 (0)