I have some objects that implement a trait. I am trying to have a val
that is static and common to all of these objects. I have read that the way to do this is to use a companion object for the trait. I have used the following:
trait Test
object Test extends Test{
val a = 1
}
object Test2 extends Test{
def test = {
val b = a
}
}
However, in the line val b = a
I get a "not found: value a" error. I would appreciate some help on how to fix this.