Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dbf3472

Browse files
authoredFeb 4, 2019
Merge pull request #1279 from cobbce/patch-1
remove Object extending App from example
2 parents fd3492c + dde4a8d commit dbf3472

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎_tour/mixin-class-composition.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,9 @@ This trait implements `foreach` by continually calling the provided function `f:
7272
We would like to combine the functionality of `StringIterator` and `RichIterator` into a single class.
7373

7474
```tut
75-
object StringIteratorTest extends App {
76-
class RichStringIter extends StringIterator("Scala") with RichIterator
77-
val richStringIter = new RichStringIter
78-
richStringIter foreach println
79-
}
75+
class RichStringIter extends StringIterator("Scala") with RichIterator
76+
val richStringIter = new RichStringIter
77+
richStringIter foreach println
8078
```
8179
The new class `RichStringIter` has `StringIterator` as a superclass and `RichIterator` as a mixin.
8280

0 commit comments

Comments
 (0)
Please sign in to comment.