This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BaseElement { | |
| def foo() { println("I like foo") } | |
| } | |
| class SubElement extends BaseElement { | |
| def bar() { println("I like bar") } | |
| } | |
| trait Base { | |
| //Abstract type T must be BaseElement or a subclass of BaseElement |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BaseElement { | |
| def foo() { println("I like foo") } | |
| } | |
| class SubElement extends BaseElement { | |
| def bar() { println("I like bar") } | |
| } | |
| trait Base[T <: BaseElement] { | |
| var map = Map[Int, T]() |