I'm just getting started with Scalaz. I'm trying to define a Zero for my type in its superclass.
class Base {
implicit def BaseZ: Zero[this.type] = zero(classOf[this.type].newInstance() )
}
class Child extends Base
~Option(null:Child) //trying to make this produce: new Child
I'm getting two errors:
1) As is, this produces "error: class type required but Base.this.type found"
2) If I change the second occurrence of this.type to Base (which isn't useful), I get
type mismatch;
found : Base
required: Base.this.type
Can anyone help me understand what's going wrong with this.type here? I really don't want to have to pass or override a type parameter to Base.