This doesn't work:
trait Trait
class Class extends Trait with Trait
Compiler complains:
<console>:8: error: trait Trait is inherited twice
class Class extends Trait with Trait
^
<console>:8: error: trait Trait is inherited twice
class Class extends Trait with Trait
^
This does:
trait Trait
class Abstraction extends Trait
class Implementation extends Abstraction with Trait
Questions:
- Why does it work?
- How is the second snippet different? (concerning the double inheritance issue)
- Is the second snippet or pattern somehow useful?