Category Archives: Scala

Self Type in Scala

abstract class A (val x: Int){ } trait B { def xPlus1: Int = x +1 } Of course this is silly. Because B does not know x defined in A, Scala compiler will complain, error: not found: value x … Continue reading

Posted in Scala | Leave a comment