Either that (option 1) or the Nat in Peano4B should not override the *type* Nat declared in Peano and made-concrete in Peano4A (option 2). Note that if you explicitly set the type Nat, you can't override it. You can achieve it through this class-with-the-same-name though, which seems like inconsistency. This is where I have troubles, I don't know which of those 2 options is the right one, and, if it is the 1st one, why is it not inconsistent.
class Peano4A extends Peano {
type Nat = NatImpl
class NatImpl(i: Int) extends NatApi {
def succ = new NatImpl(i + 1)
}
}
class Peano4B extends Peano4A {
// override type Nat = NatImpl // impossible
class NatImpl(val s: String, i: Int) extends super.NatImpl(i) {
override def succ = new NatImpl("s("+s+")", i + 1)
val n0 = new p4b.NatImpl("0", 0)
val n1 = n0.count(1)
// println(n1.s) // n1 is p4b.Nat = Peano4A#NatImpl
}