11 Oct 18:49
self type is not inherited
From: Mushtaq Ahmed <mushtaq.a <at> gmail.com>
Subject: self type is not inherited
Newsgroups: gmane.comp.lang.scala
Date: 2008-10-11 16:52:18 GMT
Subject: self type is not inherited
Newsgroups: gmane.comp.lang.scala
Date: 2008-10-11 16:52:18 GMT
Given that,
trait A
trait B {this: A =>}
Each time we extend B, we need to explicitly specify the self type as A:
trait C extends B {this: A =>}
trait D extends B {this: A =>}
trait E extends B {this: A =>}
Can't this repetition be avoided? Shouldn't self type of C, D and E default
to A unless explicitly specified otherwise? Currently, this gives the
following error:
trait F extends B
error: illegal inheritance; self-type F does not conform to B's selftype B
with A
Regards,
Mushtaq
--
--
View this message in context: http://www.nabble.com/self-type-is-not-inherited-tp19934242p19934242.html
Sent from the Scala mailing list archive at Nabble.com.
RSS Feed