|
Scala Programming Language
»
Scala - User
unnecessary class
View:
Threaded
Chronologically
All Messages
New views
1 Messages —
Rating Filter:
0
1
2
3
4
5
Alert me
unnecessary class
by Andrew Gaydenko
:: Rate this Message:
Reply to Author
|
View Threaded
|
Show Only this Message
Say, I have:
trait T {
def f : List[Int]
}
trait R extends T {
abstract override def f = super.f ::: List(1)
}
class TheT extends T {
def f : List[Int] = List(0)
}
object test {
def main(args : Array[String]) : Unit = {
val t = new TheT with R
println(t.f) // List(0, 1)
}
}
How to to avoid TheT class declaration at all (having TheT's 'f' body in
hand)?
Free embeddable forum
powered by
Nabble
Forum Help