Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/scala/stdlib/Traits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ object Traits extends AnyFlatSpec with Matchers with org.scalaexercises.definiti
}

/**
* A class can only extend from one class or trait, any subsequent extension should use the
* keyword `with`:
* A class can mixin from several traits, but only the first one uses the `extend` keyword.
* Any subsequent mixed-in trait should use the keyword `with`:
*/
def extendsFromOneTraits(res0: String) = {
case class Event(name: String)
Expand All @@ -81,7 +81,7 @@ object Traits extends AnyFlatSpec with Matchers with org.scalaexercises.definiti
def listen(event: Event): String
}

class OurListener
trait OurListener

class MyListener extends OurListener with EventListener {
def listen(event: Event): String = {
Expand Down