--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello, and thanks for your answerThere is a real différences bettween the use of val or the use of object?And if the overriding of object are unable by default it's maybe there is some thing bad beyound the use of -Yoveride-objects?
On Fri, Sep 26, 2014 at 1:13 AM, Etienne Couritas <e.cou...@gmail.com> wrote:
Define a type which cannot be override or instanciate is realy usefull ?I can't realise the adventage of the object over the var. (in this case)Because my va can contain an object with functions
If you want maximum flexibility, you need to resort to some boilerplate:
trait A {
trait InnerApi { def foo: Int }
type Inner <: InnerApi
def Inner: Inner
}
trait B extends A {
trait InnerApiB extends InnerApi { def bar: Int }
type Inner <: InnerApiB
}
final class C extends B {
class Inner extends InnerApiB { def bar = 0; def foo = bar }
def Inner = new Inner
}
-jason
trait B extends A {
trait InnerApiB extends super.Inner { def bar: Int }
type Inner <: InnerApiB
}
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.