Consider the following example:
trait T3
trait T2{
type TT4
type TT3 <: T3
}
trait T1{
type TT2 <: T2
}
now I want to write a function the roughly speaking looks as
def test[T <: T1](t: T#TT2{type TT4 = Int}#TT3) = println(t) //invalid syntax
which unfortunately is not a valid syntax. It is perfectly possible to write a function like this
def test[T <: T1](t: T#TT2#TT3) = println(t)
But I'd like to add a bit stricter restriction on T#TT2
making it to be a refined type T#TT2{ type TT4 = Int}
.
Is there any workaround?