Skip to content

Instantly share code, notes, and snippets.

@jarhart
jarhart / gist:3344846
Created August 13, 2012 23:36 — forked from matthandlersux/gist:3344752
type matching test
object Holder {
var companions = Set[AnyRef]()
def companionFor[M](m:M) = {
companions.find {
case found:M => true
case _ => false
}
}
}
abstract class SuperClass {
var initialized = false
def initialize {
initialized = true
}
}
abstract trait MetaClass[A <: SuperClass] { self: A =>
def apply(): A = {
@jarhart
jarhart / scalatestquestion.scala
Created June 29, 2012 23:56 — forked from matthandlersux/scalatestquestion.scala
scala question about traits and parameter access
object Test {
var list = List()
}
abstract class Test(protected val parameter:String) {
}
trait TestTrait { self: Test =>