This file contains 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
object Holder { | |
var companions = Set[AnyRef]() | |
def companionFor[M](m:M) = { | |
companions.find { | |
case found:M => true | |
case _ => false | |
} | |
} | |
} |
This file contains 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
abstract class SuperClass { | |
var initialized = false | |
def initialize { | |
initialized = true | |
} | |
} | |
abstract trait MetaClass[A <: SuperClass] { self: A => | |
def apply(): A = { |
This file contains 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
object Test { | |
var list = List() | |
} | |
abstract class Test(protected val parameter:String) { | |
} | |
trait TestTrait { self: Test => |