Can I have a class that can have two different self types in Scala? Or emulate it in some way?
object Hi {
trait One {
val num = 1
}
trait Two {
val num = 2
}
class Test {
this: One => {
println(num)
}
this: Two => {
println(num)
}
}
}
import Hi._
new Test with One
new Test with Two